sc-oa 0.7.0.13__py3-none-any.whl → 0.7.0.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sc-oa might be problematic. Click here for more details.
- {sc_oa-0.7.0.13.dist-info → sc_oa-0.7.0.14.dist-info}/LICENSE +23 -23
- {sc_oa-0.7.0.13.dist-info → sc_oa-0.7.0.14.dist-info}/METADATA +45 -42
- sc_oa-0.7.0.14.dist-info/RECORD +26 -0
- {sc_oa-0.7.0.13.dist-info → sc_oa-0.7.0.14.dist-info}/WHEEL +1 -1
- sphinxcontrib/__init__.py +10 -0
- sphinxcontrib/openapi/__init__.py +93 -93
- sphinxcontrib/openapi/__main__.py +86 -86
- sphinxcontrib/openapi/_lib2to3.py +378 -378
- sphinxcontrib/openapi/directive.py +58 -58
- sphinxcontrib/openapi/locale/es_ES/LC_MESSAGES/openapi.po +170 -170
- sphinxcontrib/openapi/locale/fr_FR/LC_MESSAGES/openapi.po +170 -170
- sphinxcontrib/openapi/locale/openapi.pot +168 -168
- sphinxcontrib/openapi/openapi20.py +263 -263
- sphinxcontrib/openapi/openapi30.py +748 -748
- sphinxcontrib/openapi/renderers/__init__.py +18 -18
- sphinxcontrib/openapi/renderers/_description.py +26 -26
- sphinxcontrib/openapi/renderers/_httpdomain.py +620 -620
- sphinxcontrib/openapi/renderers/_httpdomain_old.py +59 -59
- sphinxcontrib/openapi/renderers/_model.py +422 -422
- sphinxcontrib/openapi/renderers/_toc.py +48 -48
- sphinxcontrib/openapi/renderers/abc.py +46 -46
- sphinxcontrib/openapi/schema_utils.py +137 -137
- sphinxcontrib/openapi/utils.py +137 -137
- sc_oa-0.7.0.13-py3.9-nspkg.pth +0 -1
- sc_oa-0.7.0.13.dist-info/RECORD +0 -27
- sc_oa-0.7.0.13.dist-info/namespace_packages.txt +0 -1
- {sc_oa-0.7.0.13.dist-info → sc_oa-0.7.0.14.dist-info}/top_level.txt +0 -0
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"""Here lies still breathing and only renderer implementation."""
|
|
2
|
-
|
|
3
|
-
from docutils.parsers.rst import directives
|
|
4
|
-
|
|
5
|
-
from . import abc
|
|
6
|
-
from .. import openapi20, openapi30, utils
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class HttpdomainOldRenderer(abc.RestructuredTextRenderer):
|
|
10
|
-
|
|
11
|
-
option_spec = {
|
|
12
|
-
# A list of endpoints to be rendered. Endpoints must be whitespace
|
|
13
|
-
# delimited.
|
|
14
|
-
"paths": lambda s: s.split(),
|
|
15
|
-
# Regular expression patterns to includes/excludes endpoints to/from
|
|
16
|
-
# rendering. Similar to paths, the patterns must be whitespace
|
|
17
|
-
# delimited.
|
|
18
|
-
"include": lambda s: s.split(),
|
|
19
|
-
"exclude": lambda s: s.split(),
|
|
20
|
-
# Endpoints to be included based on HTTP method names.
|
|
21
|
-
"methods": lambda s: s.split(),
|
|
22
|
-
# Render the request body structure when passed.
|
|
23
|
-
"request": directives.flag,
|
|
24
|
-
# Render request/response examples when passed.
|
|
25
|
-
"examples": directives.flag, # render examples when passed
|
|
26
|
-
# Render request/response examples in one block or inline with the response codes.
|
|
27
|
-
"contextpath": directives.flag, # use the server path as prefix in service URL
|
|
28
|
-
"group_examples": directives.flag, # render examples in one block
|
|
29
|
-
# Include links to entity description
|
|
30
|
-
"entities": directives.flag,
|
|
31
|
-
# Group endpoints by tags when passed. By default, no grouping is
|
|
32
|
-
# applied and endpoints are rendered in the order they met in spec.
|
|
33
|
-
"group": directives.flag,
|
|
34
|
-
# Markup format to render OpenAPI descriptions.
|
|
35
|
-
"format": str,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
def __init__(self, state, options):
|
|
39
|
-
self._state = state
|
|
40
|
-
self._options = options
|
|
41
|
-
|
|
42
|
-
def render_restructuredtext_markup(self, spec):
|
|
43
|
-
# OpenAPI spec may contain JSON references, common properties, etc.
|
|
44
|
-
# Trying to render the spec "As Is" will require to put multiple if-s
|
|
45
|
-
# around the code. In order to simplify rendering flow, let's make it
|
|
46
|
-
# have only one (expected) schema, i.e. normalize it.
|
|
47
|
-
utils.normalize_spec(spec, **self._options)
|
|
48
|
-
|
|
49
|
-
# We support both OpenAPI 2.0 (f.k.a. Swagger) and OpenAPI 3.0.0, so
|
|
50
|
-
# determine which version we are parsing here.
|
|
51
|
-
spec_version = spec.get("openapi", spec.get("swagger", "2.0"))
|
|
52
|
-
if spec_version.startswith("2."):
|
|
53
|
-
openapihttpdomain = openapi20.openapihttpdomain
|
|
54
|
-
elif spec_version.startswith("3."):
|
|
55
|
-
openapihttpdomain = openapi30.openapihttpdomain
|
|
56
|
-
else:
|
|
57
|
-
raise ValueError("Unsupported OpenAPI version (%s)" % spec_version)
|
|
58
|
-
|
|
59
|
-
yield from openapihttpdomain(spec, **self._options)
|
|
1
|
+
"""Here lies still breathing and only renderer implementation."""
|
|
2
|
+
|
|
3
|
+
from docutils.parsers.rst import directives
|
|
4
|
+
|
|
5
|
+
from . import abc
|
|
6
|
+
from .. import openapi20, openapi30, utils
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class HttpdomainOldRenderer(abc.RestructuredTextRenderer):
|
|
10
|
+
|
|
11
|
+
option_spec = {
|
|
12
|
+
# A list of endpoints to be rendered. Endpoints must be whitespace
|
|
13
|
+
# delimited.
|
|
14
|
+
"paths": lambda s: s.split(),
|
|
15
|
+
# Regular expression patterns to includes/excludes endpoints to/from
|
|
16
|
+
# rendering. Similar to paths, the patterns must be whitespace
|
|
17
|
+
# delimited.
|
|
18
|
+
"include": lambda s: s.split(),
|
|
19
|
+
"exclude": lambda s: s.split(),
|
|
20
|
+
# Endpoints to be included based on HTTP method names.
|
|
21
|
+
"methods": lambda s: s.split(),
|
|
22
|
+
# Render the request body structure when passed.
|
|
23
|
+
"request": directives.flag,
|
|
24
|
+
# Render request/response examples when passed.
|
|
25
|
+
"examples": directives.flag, # render examples when passed
|
|
26
|
+
# Render request/response examples in one block or inline with the response codes.
|
|
27
|
+
"contextpath": directives.flag, # use the server path as prefix in service URL
|
|
28
|
+
"group_examples": directives.flag, # render examples in one block
|
|
29
|
+
# Include links to entity description
|
|
30
|
+
"entities": directives.flag,
|
|
31
|
+
# Group endpoints by tags when passed. By default, no grouping is
|
|
32
|
+
# applied and endpoints are rendered in the order they met in spec.
|
|
33
|
+
"group": directives.flag,
|
|
34
|
+
# Markup format to render OpenAPI descriptions.
|
|
35
|
+
"format": str,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
def __init__(self, state, options):
|
|
39
|
+
self._state = state
|
|
40
|
+
self._options = options
|
|
41
|
+
|
|
42
|
+
def render_restructuredtext_markup(self, spec):
|
|
43
|
+
# OpenAPI spec may contain JSON references, common properties, etc.
|
|
44
|
+
# Trying to render the spec "As Is" will require to put multiple if-s
|
|
45
|
+
# around the code. In order to simplify rendering flow, let's make it
|
|
46
|
+
# have only one (expected) schema, i.e. normalize it.
|
|
47
|
+
utils.normalize_spec(spec, **self._options)
|
|
48
|
+
|
|
49
|
+
# We support both OpenAPI 2.0 (f.k.a. Swagger) and OpenAPI 3.0.0, so
|
|
50
|
+
# determine which version we are parsing here.
|
|
51
|
+
spec_version = spec.get("openapi", spec.get("swagger", "2.0"))
|
|
52
|
+
if spec_version.startswith("2."):
|
|
53
|
+
openapihttpdomain = openapi20.openapihttpdomain
|
|
54
|
+
elif spec_version.startswith("3."):
|
|
55
|
+
openapihttpdomain = openapi30.openapihttpdomain
|
|
56
|
+
else:
|
|
57
|
+
raise ValueError("Unsupported OpenAPI version (%s)" % spec_version)
|
|
58
|
+
|
|
59
|
+
yield from openapihttpdomain(spec, **self._options)
|