You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now ideally I want to change the field name custom1 to something based on some logic. So it for first object, it can be "lookup-v1" and for second object in that response, it could be "lookup-v2".
Is there a way I can achieve this?
The text was updated successfully, but these errors were encountered:
rishijain
changed the title
loading dynamic fields during serialization
loading dynamic field names during serialization
May 20, 2024
rishijain
changed the title
loading dynamic field names during serialization
lLading dynamic field names during serialization
May 20, 2024
rishijain
changed the title
lLading dynamic field names during serialization
Loading dynamic field names during serialization
May 20, 2024
There is no way to achieve this in Panko, since the library is written upon assumption you will return the same-consistent structure. Adding support for this, will require big changes in the library that I wouldn't like to do.
I suggest wrapping the custom fields, under method attribute, like:
Assume I have a model User, and it has a field
custom1
and has other fields likeid, name
.Now I have something like this:
And after serialization, the response looks like this:
Now ideally I want to change the field name
custom1
to something based on some logic. So it for first object, it can be "lookup-v1" and for second object in that response, it could be "lookup-v2".Is there a way I can achieve this?
The text was updated successfully, but these errors were encountered: