Skip to content

Docs: Update openapi_version default value in docstrings so it matches DEFAULT_OPENAPI_VERSION #7668

@victorperezpiqueras

Description

@victorperezpiqueras

What were you searching in the docs?

I was checking the OpenAPIConfig class, looking for the openapi_version property

Is this related to an existing documentation section?

No response

How can we improve?

Update docstring with correct default openapi_version:

@dataclass
class OpenAPIConfig:
    """Configuration class for OpenAPI specification.

    This class holds all the necessary configuration parameters to generate an OpenAPI specification.

    Parameters
    ----------
    title: str
        The title of the application.
    version: str
        The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API
    openapi_version: str, default = "3.0.0" <---THIS SHOULD BE 3.1.0, AS IN DEFAULT_OPENAPI_VERSION

Same in ApiGatewayResolver:

    def get_openapi_schema(
        self,
        *,
        title: str = DEFAULT_OPENAPI_TITLE,
        version: str = DEFAULT_API_VERSION,
        openapi_version: str = DEFAULT_OPENAPI_VERSION,
        summary: str | None = None,
        description: str | None = None,
        tags: list[Tag | str] | None = None,
        servers: list[Server] | None = None,
        terms_of_service: str | None = None,
        contact: Contact | None = None,
        license_info: License | None = None,
        security_schemes: dict[str, SecurityScheme] | None = None,
        security: list[dict[str, list[str]]] | None = None,
        openapi_extensions: dict[str, Any] | None = None,
    ) -> OpenAPI:
        """
        Returns the OpenAPI schema as a pydantic model.

        Parameters
        ----------
        title: str
            The title of the application.
        version: str
            The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API
        openapi_version: str, default = "3.0.0" <---UPDATE

And similarly in get_openapi_json_schema, configure_openapi, enable_swagger

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.

Metadata

Metadata

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

Status

Coming soon

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions