Repository navigation
Conversation
simahawk
force-pushed
the
18-add-openapi_doc_base
branch
from
October 16, 2026 14:22
f063071 to
5b62244
Compare
simahawk
added a commit
to camptocamp/web-api
that referenced
this pull request
Oct 16, 2026
Pending OCA#181 (openapi_doc_base). To be removed once merged.
simahawk
added a commit
to camptocamp/web-api
that referenced
this pull request
Oct 16, 2026
Base module to document HTTP endpoints w/ OpenAPI and Swagger UI, w/o depending on any API framework and w/o exposing any URL. * `SpecBuilder`: build OpenAPI 3 documents from any list of `(url, endpoint)`, reading the routing (`api_doc` key, plain JSON schemas or params exposing `to_json_schema`) * documentation sources grouped by category and app, always protected by groups (per source and per category), registered via `ir.http._openapi_doc_sources` * `openapi.doc.mixin`: docs fields and helpers for records that are routes * `OpenApiDocsControllerMixin`: helpers for controllers to serve Swagger UI w/ category/app selectors and JSON documents * server selector for "Try it out" and curl snippets: the current domain by default (`web.base.url` might be internal), `web.base.url` and configured URLs as alternatives
simahawk
force-pushed
the
18-add-openapi_doc_base
branch
from
October 21, 2026 07:25
5b62244 to
3620e3c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
There is no shared way to document an HTTP endpoint with OpenAPI or to browse the docs: the existing one is tied to
base_rest. This module provides the building blocks to document any HTTP endpoint with OpenAPI, and to browse the docs with Swagger UI, so that every module exposing an API can document it the same way. It offers no page of its own: each module defines its routes, auth and access policy.Key features
SpecBuilder: builds an OpenAPI document from any list of routes (routing map, generator, records)ir.http._openapi_doc_sources; controllers w/ anapi_docrouting key are collected automaticallyopenapi.doc.mixin: docs fields and helpers for records that are routesOpenApiDocsControllerMixin: helpers for controllers to serve Swagger UI (category and app selectors) and the JSON docs