-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] ResourceConfig refactor #73
Comments
Would there be a way to allow the usage of the same classes for all methods? e.g. not having to set |
In the above, same class for all methods is allowed or per-class is allowed, but you mean being able to specify a class for all methods AND then override it for some methods, right? That would be nice! Do you have a configuration in mind? I am thinking something like: request_body_deserializer = [
GeneralJSONDeserializer(mimetype="application/json")
("create", [CreateSepcificJSONDeserializer(mimetype="application/json"))
] or request_body_deserializer = {
"all": [GeneralJSONDeserializer(mimetype="application/json"),]
"create": [CreateSpecificJSONDeserializer(mimetype="application/json"),
CreateSpecificXMLDeserializer(mimetype="application/xml"),]
} On another topic, Iam thinking a serializer/deserializer pair could be combined since they are often just the same schema anyway. To be given some thought... |
I think ResourceConfig can be improved:
1-
ResourceConfig
is starting to accumulate a hodgepodge of fields, but these are not quite organized, making it hard to navigate the configuration (especially for developers making an API using this library) and extend it without being overwhelmed.2- Some custom classes/objects are needed in the configuration which adds to the difficulty of navigating it and creating it. Some we have no choice (Any Serializer/Deserializer), but others we could potentially remove from the config (only for now).
Here is my suggestion for the refactor of ResourceConfig taken from https://gist.github.com/fenekku/69b49923816cd9ab160aa46f0a70f1e3#file-resources-py-L13-L49
Nice things:
This issue combines: #39 and #40 (which were both started from comments I made).
The text was updated successfully, but these errors were encountered: