Turns out that i was having a computed property on one of the components that was using a filter to get all the typeA segments that looked like this
content?.elementList[0].segments.filter( x=> x.$type = SegmentType.TypeA)
instead of
content?.elementList[0].segments.filter( x=> x.$type == SegmentType.TypeA)
or
content?.elementList[0].segments.filter( x=> x.$type === SegmentType.TypeA)
I got confused because even if I put my console.log()
as soon as I was getting the response the object was still modified by the property mentioned above, and I assumed that it might have been caused by the parsing of the object.