noirbizarre / flask-restplus

Fully featured framework for fast, easy and documented API development with Flask
http://flask-restplus.readthedocs.org
Other
2.73k stars 507 forks source link

Model Input mapping to the database model #195

Open cheesy44 opened 8 years ago

cheesy44 commented 8 years ago

@api.marshal_with(modelName) will map/filter the output from the database model to the response model. I may be missing this but how can the same happen with the input? So map the user facing model to the database model from the input?

Thanks

hellupline commented 8 years ago

you can use the expect decorator, and the to-be-deprecated request parser

http://flask-restplus.readthedocs.io/en/stable/swagger.html#the-api-expect-decorator http://flask-restplus.readthedocs.io/en/stable/parsing.html