Skip to content

Conversation

pierre-halleux
Copy link
Contributor

No description provided.

Allow to specify a description into the services that will be used into the openapi documentation.
It's not possible to use the docstring put on the service component as description since this information is lost when the final class is generated once the registery is loaded
By default in case of SessionExpiredException, Odoo return the login page with HTTP Status 200. For REST services we must return the real exception IOW 401 Unauthorize
Into the openapi documentation, declare 'id' as an integer path parameter
In HTTP GET methods, the paramters are not provided as a json document. The parameters are http query parameters. Therefore we need to translate the jsonschema defined for services available via HTTP GET into an openapi definition of the query paramters.
To avoid to redefine the generic routes in all our RestController, the routes was defined in the RestController base classe. Unfortunately even if the path into the routes was modified into the class factrory the definition of the generic routs was the same for all the Controllers inheriting from RestController. To avoid to share the definitions of these generic methods, we override the class factory into the metaclass and generate a new definition of these methods for each classes inheriting from RestController.
In the same time we must also remove the RestConroller from the controller since it's an abstract controller.
In Py3 a function becomes a method only once the class def is instanciated.
When navigating from one spec to an other, the page url is updated to include the name of the displayed page as paramter. This change takes into account this parameter when generating the swagger page to reopen the page with the selected spec open by default. In the same time, this change avoid a stacktrace when the api-docs page is called with paramters
Using the log level to enable the stack trace into the response is too dangerous. We must avoid to mix log level and development mode
@pierre-halleux pierre-halleux force-pushed the 18.0-mig-base_rest-hda branch from e1f898a to b5d2d21 Compare March 4, 2025 14:11
@pierre-halleux pierre-halleux changed the title 18.0 mig base rest hda [18.0] [MIG] base rest hda Mar 4, 2025
@pierre-halleux pierre-halleux changed the title [18.0] [MIG] base rest hda [18.0] [MIG] migrate base_rest Mar 4, 2025
@pierre-halleux pierre-halleux force-pushed the 18.0-mig-base_rest-hda branch 2 times, most recently from 76c3f43 to 3d5982b Compare March 6, 2025 09:56
@lmignon lmignon force-pushed the 18.0-mig-base_rest-hda branch from b4d880c to 7c939bc Compare March 18, 2025 10:32
@simahawk
Copy link
Contributor

/ocabot migration base_rest

@simahawk
Copy link
Contributor

Reminder to fwd port #358 (to be checked w/ oca-port).

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tech review, functional review and manual tests 🟢
Thank you!

@lmignon one remark about the deprecation 😉

@simahawk
Copy link
Contributor

@lmignon great, thanks! We can merge if good for you 😉

@lmignon
Copy link
Contributor

lmignon commented Mar 20, 2025

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-506-by-lmignon-bump-nobump, awaiting test results.

@lmignon
Copy link
Contributor

lmignon commented Mar 20, 2025

@lmignon great, thanks! We can merge if good for you 😉

for sure 😁

@OCA-git-bot OCA-git-bot merged commit 199ff91 into OCA:18.0 Mar 20, 2025
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 2b21061. Thanks a lot for contributing to OCA. ❤️

@lmignon lmignon deleted the 18.0-mig-base_rest-hda branch March 20, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.