Open SteadBytes opened 4 years ago
Hey all.
I've been thinking a lot about how best to deal with changes to models in flask-restx.
My initial thoughts are to leave the underlying structure of the project the way it is, at least for now, mainly for backwards compat and also to avoid introducing new dependencies on other libraries.
With that in mind, I kind of like the idea of offering adapters to go between commonly used external libraries (marshmallow, pydantic etc) and restx models, probably integrating @ClimenteA 's code/ideas from this thread as a starting point.
The aim would be ultimately that you can do api.model.from_<your_library>(external_model)
anytime you needed a restx type model (with support for marshalling etc).
That being said, I'm open to ideas if anyone else has a strong opinion on a different path!?
All the best, Pete
For quite some time there have been significant issues around data models, request parsing and response marshalling in
flask-restx
(carried over fromflask-restplus
). The most obvious of which is the deprecation warning about thereqparse
module in the documentation that has been in place for far too long. These changes have been put off for various reasons which I won't discuss here, however now the new fork is steadily underway I (and no doubt others) would like to start addressing this.Since this digs quite deep into the architecture of
flask-restx
there will be significant (and likely breaking) changes required. As such, this issue is to serve as a discussion around the API we would like to provide and some initial ideas of how to best proceed. This is not intended to be the starting point of hacking something together which makes things worse!I will set out my current thoughts on the topic, please contribute by adding more points and expanding on mine with more discussion.
High Level Goals:
reqparse
andmodels
General Issues/Discussion Points
api.marshal
,api.doc
decorator style?reqparse
and existingmodels
interface?Resources/Notable Libraries