APIFairy
APIFairy copied to clipboard
Schema for output not working
Hello! Is there any bug found on APIFairy response decorator? I'm trying to define a simple schema for the response but it looks like flask tries to serialize the object instead of letting it to APIFairy lib:
The argument to the response decorator is a marshmallow schema. It looks like you are passing the class of an object you want to return instead.
Hi Miguel! Thanks in advance for your answer.
In this case Ping is a marshmallow schema, since it's inheriting the 'marshmallow.Schema' class.
I'm doing the same for the @body decorator and it's working to serialize the input.
Try using the Schema class from the Flask-Marshmallow extension. See the examples in this repository for guidance.