|
19 | 19 | from aws_lambda_powertools.event_handler import content_types
|
20 | 20 | from aws_lambda_powertools.event_handler.exceptions import NotFoundError, ServiceError
|
21 | 21 | from aws_lambda_powertools.event_handler.openapi.config import OpenAPIConfig
|
22 |
| -from aws_lambda_powertools.event_handler.openapi.constants import DEFAULT_API_VERSION, DEFAULT_OPENAPI_VERSION |
| 22 | +from aws_lambda_powertools.event_handler.openapi.constants import ( |
| 23 | + DEFAULT_API_VERSION, |
| 24 | + DEFAULT_OPENAPI_TITLE, |
| 25 | + DEFAULT_OPENAPI_VERSION, |
| 26 | +) |
23 | 27 | from aws_lambda_powertools.event_handler.openapi.exceptions import RequestValidationError, SchemaValidationError
|
24 | 28 | from aws_lambda_powertools.event_handler.openapi.types import (
|
25 | 29 | COMPONENT_REF_PREFIX,
|
@@ -1546,7 +1550,7 @@ def __init__(
|
1546 | 1550 | def get_openapi_schema(
|
1547 | 1551 | self,
|
1548 | 1552 | *,
|
1549 |
| - title: str = "Powertools for AWS Lambda (Python) API", |
| 1553 | + title: str = DEFAULT_OPENAPI_TITLE, |
1550 | 1554 | version: str = DEFAULT_API_VERSION,
|
1551 | 1555 | openapi_version: str = DEFAULT_OPENAPI_VERSION,
|
1552 | 1556 | summary: str | None = None,
|
@@ -1601,7 +1605,7 @@ def get_openapi_schema(
|
1601 | 1605 | # DEPRECATION: Will be removed in v4.0.0. Use configure_api() instead.
|
1602 | 1606 | # Maintained for backwards compatibility.
|
1603 | 1607 | # See: https://github.com/aws-powertools/powertools-lambda-python/issues/6122
|
1604 |
| - if title == "Powertools for AWS Lambda (Python) API" and self.openapi_config.title: |
| 1608 | + if title == DEFAULT_OPENAPI_TITLE and self.openapi_config.title: |
1605 | 1609 | title = self.openapi_config.title
|
1606 | 1610 |
|
1607 | 1611 | if version == DEFAULT_API_VERSION and self.openapi_config.version:
|
@@ -1751,7 +1755,7 @@ def _determine_openapi_version(openapi_version: str):
|
1751 | 1755 | def get_openapi_json_schema(
|
1752 | 1756 | self,
|
1753 | 1757 | *,
|
1754 |
| - title: str = "Powertools for AWS Lambda (Python) API", |
| 1758 | + title: str = DEFAULT_OPENAPI_TITLE, |
1755 | 1759 | version: str = DEFAULT_API_VERSION,
|
1756 | 1760 | openapi_version: str = DEFAULT_OPENAPI_VERSION,
|
1757 | 1761 | summary: str | None = None,
|
@@ -1828,7 +1832,7 @@ def get_openapi_json_schema(
|
1828 | 1832 |
|
1829 | 1833 | def configure_openapi(
|
1830 | 1834 | self,
|
1831 |
| - title: str = "Powertools for AWS Lambda (Python) API", |
| 1835 | + title: str = DEFAULT_OPENAPI_TITLE, |
1832 | 1836 | version: str = DEFAULT_API_VERSION,
|
1833 | 1837 | openapi_version: str = DEFAULT_OPENAPI_VERSION,
|
1834 | 1838 | summary: str | None = None,
|
@@ -1913,7 +1917,7 @@ def enable_swagger(
|
1913 | 1917 | self,
|
1914 | 1918 | *,
|
1915 | 1919 | path: str = "/swagger",
|
1916 |
| - title: str = "Powertools for AWS Lambda (Python) API", |
| 1920 | + title: str = DEFAULT_OPENAPI_TITLE, |
1917 | 1921 | version: str = DEFAULT_API_VERSION,
|
1918 | 1922 | openapi_version: str = DEFAULT_OPENAPI_VERSION,
|
1919 | 1923 | summary: str | None = None,
|
|
0 commit comments