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
Is there a way I can choose inside a serializer to render another serializer based on an attribute ?
Here is my code which is triggered into another serializer with has_many :activities, each_serializer: ActivitySerializer
But I'd like to filter has_many: levels based on another attribute called organization inside Level or at least to choose which levels I want to return.
Is it possible ?
Thanks again !
The text was updated successfully, but these errors were encountered:
If I understand you correctly you want to change the serializer of "levels" instead of LevelSerializer use other serializer based on level attributes?
If so, currently it's not supported since Panko don't have "dynamic runtime", Panko decides which serializers to choose before starting the serialization to optimize for performance.
It's possible to implement this with a bit of hack and not a natural way currently. If this feature is blocking you from using Panko, let's discuss on a proper solution and I will be happy to accept a PR.
Hi there ☀️
Is there a way I can choose inside a serializer to render another serializer based on an attribute ?
Here is my code which is triggered into another serializer with
has_many :activities, each_serializer: ActivitySerializer
But I'd like to filter
has_many: levels
based on another attribute called organization insideLevel
or at least to choose which levels I want to return.Is it possible ?
Thanks again !
The text was updated successfully, but these errors were encountered: