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 that possible somehow to have nested serializers, which contain object of the same class?
For example:
class PersonSerializer(serpy.Serializer):
name = serpy.Field()
age = serpy.IntField()
childrens = PersonSerializer(many=True)
This code of course is invalid, but it should visualize my problem.
Marshmallow have something like: childrens = fields.Nested('self', many=True)
If it's not possible I may try to implement feature like this.
The text was updated successfully, but these errors were encountered:
That's just nesting a /different/ class - the issue comes when you need to nest the exact class you're defining.
For standard serializers, there's https://github.com/heywbj/django-rest-framework-recursive
but it would be nice if there was a way to do this withing serpy.
Is that possible somehow to have nested serializers, which contain object of the same class?
For example:
This code of course is invalid, but it should visualize my problem.
Marshmallow have something like:
childrens = fields.Nested('self', many=True)
If it's not possible I may try to implement feature like this.
The text was updated successfully, but these errors were encountered: