Skip to content
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

[16.0] [IMP] fastapi: Add endpoint public_url field #438

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fastapi/models/fastapi_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class FastapiEndpoint(models.Model):
docs_url: str = fields.Char(compute="_compute_urls")
redoc_url: str = fields.Char(compute="_compute_urls")
openapi_url: str = fields.Char(compute="_compute_urls")
public_url: str = fields.Char(
help="The public URL of the API.\n"
"This is an informative data item that can be used by "
"other modules, for example, to construct URLs in mails."
)
company_id = fields.Many2one(
"res.company",
compute="_compute_company_id",
Expand Down
2 changes: 1 addition & 1 deletion fastapi/models/fastapi_endpoint_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FastapiEndpoint(models.Model):
)
demo_auth_method = fields.Selection(
selection=[("api_key", "Api Key"), ("http_basic", "HTTP Basic")],
string="Authenciation method",
string="Authentication method",
)

def _get_fastapi_routers(self) -> List[APIRouter]:
Expand Down
6 changes: 6 additions & 0 deletions fastapi/views/fastapi_endpoint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
<field name="docs_url" widget="url" />
<field name="redoc_url" widget="url" />
<field name="openapi_url" widget="url" />
<field
name="public_url"
widget="url"
placeholder="https://api.shop.example.com/"
/>
</group>
</group>
<span name="configuration" />
Expand Down Expand Up @@ -95,6 +100,7 @@
<field name="docs_url" widget="url" />
<field name="redoc_url" widget="url" />
<field name="openapi_url" widget="url" />
<field name="public_url" widget="url" />
<button
name="action_sync_registry"
string="Sync Registry"
Expand Down
Loading