jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

BUG: Self nested schemas result in null values. #186

Open Tonixhymshiti opened 4 years ago

Tonixhymshiti commented 4 years ago

When using self nested schemas with @marshall_with, the result in swagger for that schema appears null.

For instance:

class UserSchema(Schema):
      id: fields.Int()
      name: fields.String()
      friends: fields.Nested(lambda: UserSchema(many=True))

Results in swagger as { id: Integer, name: string, friends: [ null ] }