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

Fix documentation generation #807

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix documentation generation
`tox -e docs` runs cleanly:
* Set the default language to 'en'
* Fix class references in doc strings
  • Loading branch information
jwhitlock committed Aug 25, 2022
commit 9522798c2bd07df4899a67450f29774f250dfc51
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
16 changes: 8 additions & 8 deletions src/drf_yasg/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def __init__(self, info=None, _url=None, _prefix=None, _version=None, consumes=N
security_definitions=None, security=None, paths=None, definitions=None, **extra):
"""Root Swagger object.

:param .Info info: info object
:param Info info: info object
:param str _url: URL used for setting the API host and scheme
:param str _prefix: api path prefix to use in setting basePath; this will be appended to the wsgi
SCRIPT_NAME prefix or Django's FORCE_SCRIPT_NAME if applicable
Expand Down Expand Up @@ -391,7 +391,7 @@ def __init__(self, type=None, format=None, enum=None, pattern=None, items=None,
:param str format: value format, see OpenAPI spec
:param list enum: restrict possible values
:param str pattern: pattern if type is ``string``
:param .Items items: only valid if `type` is ``array``
:param Items items: only valid if `type` is ``array``
"""
super(Items, self).__init__(**extra)
assert type is not None, "type is required!"
Expand Down Expand Up @@ -420,7 +420,7 @@ def __init__(self, name, in_, description=None, required=None, schema=None,
:param str format: value format, see OpenAPI spec
:param list enum: restrict possible values
:param str pattern: pattern if type is ``string``
:param .Items items: only valid if `type` is ``array``
:param Items items: only valid if `type` is ``array``
:param default: default value if the parameter is not provided; must conform to parameter type
"""
super(Parameter, self).__init__(**extra)
Expand Down Expand Up @@ -512,10 +512,10 @@ def __init__(self, resolver, name, scope, expected_type, ignore_unresolved=False
"""Base class for all reference types. A reference object has only one property, ``$ref``, which must be a JSON
reference to a valid object in the specification, e.g. ``#/definitions/Article`` to refer to an article model.

:param .ReferenceResolver resolver: component resolver which must contain the referneced object
:param ReferenceResolver resolver: component resolver which must contain the referneced object
:param str name: referenced object name, e.g. "Article"
:param str scope: reference scope, e.g. "definitions"
:param type[.SwaggerDict] expected_type: the expected type that will be asserted on the object found in resolver
:param type[SwaggerDict] expected_type: the expected type that will be asserted on the object found in resolver
:param bool ignore_unresolved: do not throw if the referenced object does not exist
"""
super(_Ref, self).__init__()
Expand All @@ -530,7 +530,7 @@ def __init__(self, resolver, name, scope, expected_type, ignore_unresolved=False
def resolve(self, resolver):
"""Get the object targeted by this reference from the given component resolver.

:param .ReferenceResolver resolver: component resolver which must contain the referneced object
:param ReferenceResolver resolver: component resolver which must contain the referneced object
:returns: the target object
"""
ref_match = self.ref_name_re.match(self.ref)
Expand All @@ -549,7 +549,7 @@ class SchemaRef(_Ref):
def __init__(self, resolver, schema_name, ignore_unresolved=False):
"""Adds a reference to a named Schema defined in the ``#/definitions/`` object.

:param .ReferenceResolver resolver: component resolver which must contain the definition
:param ReferenceResolver resolver: component resolver which must contain the definition
:param str schema_name: schema name
:param bool ignore_unresolved: do not throw if the referenced object does not exist
"""
Expand Down Expand Up @@ -647,7 +647,7 @@ def with_scope(self, scope):

:param str scope: target scope, must be in this resolver's `scopes`
:return: the bound resolver
:rtype: .ReferenceResolver
:rtype: ReferenceResolver
"""
assert scope in self.scopes, "unknown scope %s" % scope
ret = ReferenceResolver(force_init=True)
Expand Down
3 changes: 2 additions & 1 deletion src/drf_yasg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def get_schema_view(info=None, url=None, patterns=None, urlconf=None, public=Fal
generator_class=None, authentication_classes=None, permission_classes=None):
"""Create a SchemaView class with default renderers and generators.

:param .Info info: information about the API; if omitted, defaults to :ref:`DEFAULT_INFO <default-swagger-settings>`
:param drf_yasg.openapi.Info info: information about the API; if omitted,
defaults to :ref:`DEFAULT_INFO <default-swagger-settings>`
:param str url: same as :class:`.OpenAPISchemaGenerator`
:param patterns: same as :class:`.OpenAPISchemaGenerator`
:param urlconf: same as :class:`.OpenAPISchemaGenerator`
Expand Down