Skip to content

[18.0][FW][IMP] fastapi: expose FastAPI docs only if field is set - #679

Open
chaule97 wants to merge 1 commit into
OCA:18.0from
chaule97:18.0-fw-fastapi-expose-docs
Open

chaule97 wants to merge 1 commit into
OCA:18.0from
chaule97:18.0-fw-fastapi-expose-docs

Conversation

@chaule97

Copy link
Copy Markdown

Forward port of #537 from 16.0.

Right now the FastAPI documentation endpoints (Swagger, Redoc, OpenAPI) of every endpoint can be reached by anyone. Some deployments don't need them, and some aren't allowed to expose them.

This PR adds an Expose FastAPI docs checkbox (expose_doc_urls) to the FastAPI endpoint form. When it is unticked,
docs_url, redoc_url and openapi_url are set to None on the FastAPI app, so those routes return 404. Changing the field rebuilds the app.

@oca-cla-bot

oca-cla-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@chaule97

Copy link
Copy Markdown
Author

Hi @PicchiSeba, this is a forward port of your #537 to 18.0. The OCA CLA bot reports that picchiseba+git@gmail.com is not covered by a CLA. Could you sign it (or add this email to your existing CLA) at https://odoo-community.org/cla? Thanks!

@chaule97
chaule97 force-pushed the 18.0-fw-fastapi-expose-docs branch from 7cb25fd to 3d74e7f Compare October 27, 2026 02:01

@PicchiSeba PicchiSeba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review: LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants