Improve basePath and versioning documentation

openapi3 1.2.0
Cristi Vîjdea 2018-01-12 04:06:29 +01:00
parent 4445137d55
commit 6c4dcb18bb
2 changed files with 14 additions and 5 deletions

View File

@ -44,8 +44,8 @@ Features
`flex <https://github.com/pipermerriam/flex>`_ `flex <https://github.com/pipermerriam/flex>`_
- supports Django REST Framework API versioning - supports Django REST Framework API versioning
+ ``URLPathVersioning``, ``NamespaceVersioning`` and ``HostnameVersioning`` are supported + ``URLPathVersioning`` and ``NamespaceVersioning`` are supported
+ ``AcceptHeaderVersioning`` and ``QueryParameterVersioning`` are not currently supported + ``HostnameVersioning``, ``AcceptHeaderVersioning`` and ``QueryParameterVersioning`` are not currently supported
.. figure:: https://raw.githubusercontent.com/axnsan12/drf-yasg/1.0.2/screenshots/redoc-nested-response.png .. figure:: https://raw.githubusercontent.com/axnsan12/drf-yasg/1.0.2/screenshots/redoc-nested-response.png
:width: 100% :width: 100%

View File

@ -129,8 +129,8 @@ This section describes where information is sourced from when using the default
<http://www.django-rest-framework.org/api-guide/schemas/#schemas-as-documentation>`_ <http://www.django-rest-framework.org/api-guide/schemas/#schemas-as-documentation>`_
* .. _custom-spec-base-url: * .. _custom-spec-base-url:
the base URL for the API consists of three values - the ``host``, ``schemes`` and ``basePath`` attributes The base URL for the API consists of three values - the ``host``, ``schemes`` and ``basePath`` attributes
* the host name and scheme are determined, in descending order of priority: * The host name and scheme are determined, in descending order of priority:
+ from the ``url`` argument passed to :func:`.get_schema_view` (more specifically, to the underlying + from the ``url`` argument passed to :func:`.get_schema_view` (more specifically, to the underlying
:class:`.OpenAPISchemaGenerator`) :class:`.OpenAPISchemaGenerator`)
@ -139,7 +139,7 @@ This section describes where information is sourced from when using the default
For example, an url of ``https://www.example.com:8080/some/path`` will populate the ``host`` and ``schemes`` For example, an url of ``https://www.example.com:8080/some/path`` will populate the ``host`` and ``schemes``
attributes with ``www.example.com:8080`` and ``['https']``, respectively. The path component will be ignored. attributes with ``www.example.com:8080`` and ``['https']``, respectively. The path component will be ignored.
* the base path is determined as the concatenation of two variables: * The base path is determined as the concatenation of two variables:
#. the `SCRIPT_NAME`_ wsgi environment variable; this is set, for example, when serving the site from a #. the `SCRIPT_NAME`_ wsgi environment variable; this is set, for example, when serving the site from a
sub-path using web server url rewriting sub-path using web server url rewriting
@ -151,6 +151,15 @@ This section describes where information is sourced from when using the default
#. the longest common path prefix of all the urls in your API - see :meth:`.determine_path_prefix` #. the longest common path prefix of all the urls in your API - see :meth:`.determine_path_prefix`
* When using API versioning with ``NamespaceVersioning`` or ``URLPathVersioning``, versioned endpoints that do not
match the version used to access the ``SchemaView`` will be excluded from the endpoint list - for example,
``/api/v1.0/endpoint`` will be shown when viewing ``/api/v1.0/swagger/``, while ``/api/v2.0/endpoint`` will not
Other versioning schemes are not presently supported.
.. versionadded:: 1.2
Base path and versioning support.
.. _custom-spec-swagger-auto-schema: .. _custom-spec-swagger-auto-schema: