Transforming a response from an array to an object via configuration. #3884
Unanswered
gablabelle
asked this question in
Q&A
Replies: 1 comment
-
Not ideal to not be able to replicate the issue. Are you using other transforms in addition to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The BE we have implements pagination via response headers. So we've enabled
includeHttpDetails
in our .meshrc.yaml file but for these endpoints returning arrays we end up withhttpDetails
field of type JSON being added to every single item of the array.So in order to avoid these we're trying to transform this array into an object so we can query it this way. Where the
list
is the original shape of the array.We use composer function to shape the object and clean up the httpDetails to our liking.
I was able to successfully implement this in a codesanbox using the Pet API and it works.
The problem is that when I implement this using our Swagger files, the list only contains the IDs and not the rest of the data for each items.
When debugging I see the BE response and ALL the data I want but the response of the
next
call only returns IDsThis driving me nuts LOL but I know I'm probably doing something wrong.
Any help would be appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions