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
[13.0] base_rest: New api #71
Conversation
…ialisable to/from json/yaml
… to get the registry from the context since it's always available on the schema class
… fixes the incompatibility with the latest marshmallow version
…a property of datamodel instances as well as on marshmallow schema instances.
Not sure if related with this PR but at start running an instance I've got this error:
|
@HviorForgeFlow Thank you for the report. I'll take a look ASAP.This error is strange. The mapper component should not be returned by the lookup into the component registry since it's not registered for the rest service collection.. |
… collection This specific lookup is required to filter out component without collection. In the same time we must also filter out components that are not services
…bers This is required to avoid some trouble with properties resolved by the method inspect.getmembers and accessing resources not yet completly initialized
@HviorForgeFlow The encountered issue should be resolved by the 2 last commits. |
It is working fine now thanks! |
@HviorForgeFlow Thank you for the feedback. If you need to develop new services, I encourage you to use the new api and datamodels. It's much more flexible and easier to maintain. |
@guewen @gurneyalex The new API is now also available for Odoo 13. It would be nice if you could use-it / test-it with your new WMS mobile app 😏 |
…server error if a json request is made with bad json
|
@lmignon before I do a PR, I'd like to know what you think.
Currently it does seem to me as bringing unnecessary steps, but I am maybe missing something. |
@kevinkhao Sorry but I don't understand your question. The |
My idea was that when we define a route, we should just return a dict and the module will take care to do self.env.datamodel["my.output.datamodel"].load(resulting_dict) so that we can save 1 line at the end of our route definition. But after thinking about it, I'm still not sure about that idea. Calling at the end of all my routes: |
@kevinkhao But we don't have to declare a route by ourself. Routes are dynamically generated by the framework based on the |
Merge remote-tracking branch 'origin/13.0-48-port' into 14.0-migrate-base-rest-new-api
@lmignon sorry, was on holidays and missed your msg. I'll skim through your last changes in a while. |
@hparfr, @sebastienbeau Are you OK with this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests I had conducted so far on WMS shows that it seams to work.
I will do more testing when porting shopinvader soon and open issues or propose PR if needed.
This PR has the |
@lmignon good to merge then? |
/ocabot merge major |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at e9f76f2. Thanks a lot for contributing to OCA. ❤️ |
youhou \o/ |
Foward port of #48