Skip to content

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

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

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

Conversation

@chaule97

@chaule97 chaule97 commented Nov 2, 2026

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.

@chaule97

chaule97 commented Nov 2, 2026

Copy link
Copy Markdown
Author

Ciao @PicchiSeba , Salut @lmignon. Could you please review this branch?

@lmignon

lmignon commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@chaule97 Fasapi is not yet migrated in 20.0.

@chaule97

chaule97 commented Nov 2, 2026

Copy link
Copy Markdown
Author

@chaule97 Fasapi is not yet migrated in 20.0.

Pardon me. Let me migrate it

@ntsirintanis

Copy link
Copy Markdown

@chaule97 Fasapi is not yet migrated in 20.0.

Pardon me. Let me migrate it

this does exist however #652

@chaule97

chaule97 commented Nov 2, 2026

Copy link
Copy Markdown
Author

@chaule97 Fasapi is not yet migrated in 20.0.

Pardon me. Let me migrate it

this does exist however #652

I prepared my local follow-up branch. But I will wait the author

@chaule97
chaule97 marked this pull request as draft November 2, 2026 09:55
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.

5 participants