Skip to content

Commit

Permalink
doc - exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Aug 10, 2023
1 parent fd18a6a commit 7ec6665
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
29 changes: 14 additions & 15 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ Parameters are part of the operation specification and can be in

.. autoclass:: aiopenapi3.v20.parameter.Parameter
:members:
:undoc-members: model_config, model_fields
:exclude-members: model_config, model_fields
:undoc-members:
:inherited-members: aiopenapi3.base.ParameterBase
:noindex:

.. autoclass:: aiopenapi3.v30.parameter.Parameter
:members:
:undoc-members: model_config, model_fields
:exclude-members: model_config, model_fields, validate_Parameter
:undoc-members:
:inherited-members: aiopenapi3.base.ParameterBase
:noindex:

Parameter Encoding
Expand All @@ -64,12 +68,17 @@ Additionally Swagger 2.0 has a different encoding strategy to OpenAPI 3.x.

.. autoclass:: aiopenapi3.v20.parameter._ParameterCodec
:members:
:undoc-members: SEPERATOR_VALUES
:exclude-members: SEPERATOR_VALUES
:undoc-members:
:private-members: _encode, _decode
:noindex:

.. autoclass:: aiopenapi3.v30.parameter._ParameterCodec
:members:

:exclude-members: SEPERATOR_VALUES
:undoc-members:
:private-members: _encode, _decode
:noindex:

Plugin Interface
================
Expand Down Expand Up @@ -189,17 +198,7 @@ of the document, and loaded relative to the basedir of the RedirectLoader.
Exceptions
==========

.. inheritance-diagram:: aiopenapi3.errors.SpecError \
aiopenapi3.errors.ReferenceResolutionError \
aiopenapi3.errors.OperationParameterValidationError \
aiopenapi3.errors.ParameterFormatError \
aiopenapi3.errors.HTTPError \
aiopenapi3.errors.RequestError \
aiopenapi3.errors.ResponseError \
aiopenapi3.errors.ContentTypeError \
aiopenapi3.errors.HTTPStatusError \
aiopenapi3.errors.ResponseDecodingError \
aiopenapi3.errors.ResponseSchemaError
.. inheritance-diagram:: aiopenapi3.errors.SpecError aiopenapi3.errors.ReferenceResolutionError aiopenapi3.errors.OperationParameterValidationError aiopenapi3.errors.ParameterFormatError aiopenapi3.errors.HTTPError aiopenapi3.errors.RequestError aiopenapi3.errors.ResponseError aiopenapi3.errors.ContentTypeError aiopenapi3.errors.HTTPStatusError aiopenapi3.errors.ResponseDecodingError aiopenapi3.errors.ResponseSchemaError
:top-classes: aiopenapi3.errors.BaseError
:parts: -1

Expand Down
19 changes: 12 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ def linkcode_resolve(domain, info):
# e.g. object is a typing.Union
return None

# Path("…/aiopenapi3/__init__.py").parent.parent == "…"
libdir = Path(file)
while libdir.name not in ("/", "aiopenapi3"):
libdir = libdir.parent
libdir = libdir.parent
assert libdir.name == "site-packages"
linkcode_file = Path(file).relative_to(libdir)
import site

f = Path(file)
for s in site.getsitepackages():
if f.is_relative_to(s):
linkcode_file = f.relative_to(s)
break
else:
return None
if linkcode_file.parts[0] != "aiopenapi3":
return None
linkcode_file = str(linkcode_file)
start, end = lines[1], lines[1] + len(lines[0]) - 1
return f"{linkcode_url}/{linkcode_file}#L{start}-L{end}"

Expand Down

0 comments on commit 7ec6665

Please sign in to comment.