sc-oa 0.7.0.13__py3-none-any.whl → 0.7.0.15__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.

@@ -1,17 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: sc-oa
3
- Version: 0.7.0.13
3
+ Version: 0.7.0.15
4
4
  Summary: Fork of the OpenAPI (fka Swagger) spec renderer for Sphinx
5
5
  Home-page: https://github.com/olivier-heurtier/sphinxcontrib-openapi/tree/mymaster
6
6
  Author: Ihor Kalnytskyi
7
- Requires-Dist: sphinx <7.0
8
- Requires-Dist: sphinxcontrib-httpdomain
9
- Requires-Dist: PyYAML
10
- Requires-Dist: jsonschema
11
- Requires-Dist: m2r2
12
- Requires-Dist: picobox
13
- Requires-Dist: deepmerge
14
-
15
7
  Olivier Heurtier
16
8
  Author-email: ihor@kalnytskyi.com
17
9
  License: BSD
@@ -28,15 +20,18 @@ Classifier: Programming Language :: Python :: 3.8
28
20
  Classifier: Programming Language :: Python :: 3.9
29
21
  Classifier: Programming Language :: Python :: 3.10
30
22
  Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
31
24
  Classifier: Programming Language :: Python :: Implementation :: CPython
32
25
  Classifier: Framework :: Sphinx
33
26
  Classifier: Framework :: Sphinx :: Extension
34
27
  Requires-Python: >=3.8
35
28
  License-File: LICENSE
36
- Requires-Dist: sphinx<7.0
29
+ Requires-Dist: sphinx
37
30
  Requires-Dist: sphinxcontrib-httpdomain
38
31
  Requires-Dist: PyYAML
39
32
  Requires-Dist: jsonschema
40
33
  Requires-Dist: m2r2
41
34
  Requires-Dist: picobox
42
35
  Requires-Dist: deepmerge
36
+ Requires-Dist: setuptools
37
+ Dynamic: license-file
@@ -1,10 +1,11 @@
1
- sc_oa-0.7.0.13-py3.9-nspkg.pth,sha256=YYcv3GPokof0Lzq3hZHkJIlfNzBys5lF7Lt7JGRAP04,575
2
- sphinxcontrib/openapi/__init__.py,sha256=LmtCBI-dTDmiKvrCSmg5YCzv0au6VCiNuZbULg0LvAs,3168
1
+ sc_oa-0.7.0.15.dist-info/licenses/LICENSE,sha256=tgm4r1GgqXjKU6uEH1LIWT7ncoq7S56ZbuxNW-F94iU,1342
2
+ sphinxcontrib/__init__.py,sha256=lT1-9KgirBnjSt96Te_iPODBQdpXXnxmZa8yMD8-TYw,269
3
+ sphinxcontrib/openapi/__init__.py,sha256=U1Y6TAHjvJ4fky2prU1k_Vs9YtROsZq3RlBQPDgYOLY,3181
3
4
  sphinxcontrib/openapi/__main__.py,sha256=CeXNtxW1vYEwojIlVxlMhoXz2qIxsCbJp58JEIoo5Js,2522
4
5
  sphinxcontrib/openapi/_lib2to3.py,sha256=4LDmNmnGKTfXeq9TbVR0YXbwjYhFwq89zGA6XOtYgts,14002
5
6
  sphinxcontrib/openapi/directive.py,sha256=FRZ2JgOekkNK-ltpkNjTDkEpJdkZa5PyXCisHsBa9bU,2117
6
7
  sphinxcontrib/openapi/openapi20.py,sha256=zkwCm4aeZLMFNLM-uzj6UJQ4rHtFPdc95Airl3tpd78,9247
7
- sphinxcontrib/openapi/openapi30.py,sha256=n92psjyd29EHfaz1a8AtUJhuSD7U3tBAGSrUnTl6bqM,29804
8
+ sphinxcontrib/openapi/openapi30.py,sha256=PfXQ7N2fPz2GtWAcvwatDv2l7X5o8npblLLaGXxvbyA,29881
8
9
  sphinxcontrib/openapi/schema_utils.py,sha256=mI6_4-b8b9j8dane9rHM5y9-Pe7yJgFuLQCBzQWLn3k,4583
9
10
  sphinxcontrib/openapi/utils.py,sha256=XGgO2HH6iYlPmn7jP-p36vlKxa50QM4TMnCg8I7-g-g,4480
10
11
  sphinxcontrib/openapi/locale/openapi.pot,sha256=69Ry6f7i1NPPE8AxGBBjAJNlK2klcWDbW01Z4eZeTtw,3999
@@ -16,12 +17,10 @@ sphinxcontrib/openapi/renderers/__init__.py,sha256=76shdyGAuHpJ9Gy3y0MQP1hyT3OMI
16
17
  sphinxcontrib/openapi/renderers/_description.py,sha256=1J_e_4nl4wMT2dGkYdNbdQH80UuBJsNNQPq5axlcswM,728
17
18
  sphinxcontrib/openapi/renderers/_httpdomain.py,sha256=vLpVQts97dRUzLi4lrPcD1UzGG7dBiPWgnPzbeIozdk,25166
18
19
  sphinxcontrib/openapi/renderers/_httpdomain_old.py,sha256=4rbrX_zAaobYgwAI0veDSDhjPNWX4iIJJz9Sp-bKxcg,2691
19
- sphinxcontrib/openapi/renderers/_model.py,sha256=z2R07XVlk5h5YwGbdqFDo2Oe6cFmvADMeV6eebms0hw,15520
20
+ sphinxcontrib/openapi/renderers/_model.py,sha256=Cb6eYXU7tVuDbwVnnECkyjKWw5lgWzFKVLpEY-yK1Z0,15867
20
21
  sphinxcontrib/openapi/renderers/_toc.py,sha256=vY0giwCeyoBejkhEDD0Ok_vGCtZKobICnb1CK7vhDJQ,1526
21
22
  sphinxcontrib/openapi/renderers/abc.py,sha256=CuIda0iT0jdEUd2OBGQdq4VcHl2XWKoCAayYztKAzOA,1531
22
- sc_oa-0.7.0.13.dist-info/LICENSE,sha256=tgm4r1GgqXjKU6uEH1LIWT7ncoq7S56ZbuxNW-F94iU,1342
23
- sc_oa-0.7.0.13.dist-info/METADATA,sha256=wIXidbNIwAyaEzfzXxAkBoRbqyCZjDBBUzdO3hvuobg,1499
24
- sc_oa-0.7.0.13.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
25
- sc_oa-0.7.0.13.dist-info/namespace_packages.txt,sha256=VJrV3_vaiKQVgVpR0I1iecxoO0drzGu-M0j40PVP2QQ,14
26
- sc_oa-0.7.0.13.dist-info/top_level.txt,sha256=VJrV3_vaiKQVgVpR0I1iecxoO0drzGu-M0j40PVP2QQ,14
27
- sc_oa-0.7.0.13.dist-info/RECORD,,
23
+ sc_oa-0.7.0.15.dist-info/METADATA,sha256=LrAexuL3wY6he4XhL0NwuxHsow_wQ5vv6V-X-JFd7z4,1405
24
+ sc_oa-0.7.0.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ sc_oa-0.7.0.15.dist-info/top_level.txt,sha256=VJrV3_vaiKQVgVpR0I1iecxoO0drzGu-M0j40PVP2QQ,14
26
+ sc_oa-0.7.0.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,10 @@
1
+ """
2
+ sphinxcontrib
3
+ ~~~~~~~~~~~~~
4
+
5
+ This package is a namespace package that contains all extensions
6
+ distributed in the ``sphinx-contrib`` distribution.
7
+
8
+ :copyright: (c) 2016 by Igor Kalnitsky.
9
+ :license: BSD, see LICENSE for details.
10
+ """
@@ -1,4 +1,4 @@
1
- """
1
+ """get_distribution
2
2
  sphinxcontrib.openapi
3
3
  ---------------------
4
4
 
@@ -10,15 +10,15 @@
10
10
  """
11
11
 
12
12
  import os
13
- from pkg_resources import get_distribution, DistributionNotFound
13
+ from importlib.metadata import distribution, PackageNotFoundError
14
14
  from sphinxcontrib.openapi import renderers, directive
15
15
  from sphinx.domains import Domain
16
16
  import yaml
17
17
  from docutils import nodes
18
18
 
19
19
  try:
20
- __version__ = get_distribution(__name__).version
21
- except DistributionNotFound:
20
+ __version__ = distribution(__name__).version
21
+ except PackageNotFoundError:
22
22
  # package is not installed
23
23
  __version__ = None
24
24
 
@@ -144,7 +144,8 @@ def _parse_schema(schema, method):
144
144
  del example[k]
145
145
  ret = collections.OrderedDict(example)
146
146
  # XXX should be True to be compliant with OpenAPI
147
- if schema.get('additionalProperties', False) and '...' not in example:
147
+ if (schema.get('additionalProperties', False) or 'type' not in schema) and \
148
+ '...' not in example:
148
149
  # materialize in the example the fact that additional properties can be added
149
150
  ret['...'] = '...'
150
151
  return ret
@@ -160,7 +161,7 @@ def _parse_schema(schema, method):
160
161
  results.append((name, result))
161
162
 
162
163
  # XXX should be True to be compliant with OpenAPI
163
- if schema.get('additionalProperties', False):
164
+ if schema.get('additionalProperties', False) or 'type' not in schema:
164
165
  # materialize in the example the fact that additional properties can be added
165
166
  results.append(("...", "..."))
166
167
 
@@ -245,9 +245,7 @@ def _process_one(prefix, schema, mandatory, entities, convert):
245
245
 
246
246
 
247
247
  def _build(name, schema, entities, convert, options):
248
- if 'type' not in schema:
249
- schema['type'] = 'object'
250
- if schema.get('type', '') not in ['object', 'array']:
248
+ if 'type' in schema and schema['type'] not in ['object', 'array']:
251
249
  return ''
252
250
 
253
251
  yield ''
@@ -257,27 +255,32 @@ def _build(name, schema, entities, convert, options):
257
255
  yield options['header'] * len(name)
258
256
  yield ''
259
257
  D = _get_description(schema, convert)
258
+ if 'type' not in schema and not (set(['oneOf', 'allOf', 'anyOf']) & schema.keys()):
259
+ D += '\n' + _('Any type of content is accepted (number, string or object).')
260
260
  if D:
261
261
  yield D
262
262
  yield ''
263
- yield '.. list-table:: ' + name
264
- yield ' :header-rows: 1'
265
- yield ' :widths: 25 25 45 15'
266
- yield ' :class: longtable'
267
- yield ''
268
- yield ' * - ' + _('Attribute')
269
- yield ' - ' + _('Type')
270
- yield ' - ' + _('Description')
271
- yield ' - ' + _('Required')
272
-
273
- for item in _process_one([], schema, False, entities, convert):
274
- if str(item[0]):
275
- yield ' * - ``' + str(item[0]) + '``'
276
- else:
277
- yield ' * - ' + _('N/A')
278
- yield ' - ' + textwrap.indent(str(item[1]), ' ').lstrip()
279
- yield ' - ' + textwrap.indent(str(item[2]), ' ').lstrip()
280
- yield ' - ' + _('Yes') if item[3] else ' -'
263
+ if 'type' not in schema and not (set(['oneOf', 'allOf', 'anyOf']) & schema.keys()):
264
+ pass
265
+ else:
266
+ yield '.. list-table:: ' + name
267
+ yield ' :header-rows: 1'
268
+ yield ' :widths: 25 25 45 15'
269
+ yield ' :class: longtable'
270
+ yield ''
271
+ yield ' * - ' + _('Attribute')
272
+ yield ' - ' + _('Type')
273
+ yield ' - ' + _('Description')
274
+ yield ' - ' + _('Required')
275
+
276
+ for item in _process_one([], schema, False, entities, convert):
277
+ if str(item[0]):
278
+ yield ' * - ``' + str(item[0]) + '``'
279
+ else:
280
+ yield ' * - ' + _('N/A')
281
+ yield ' - ' + textwrap.indent(str(item[1]), ' ').lstrip()
282
+ yield ' - ' + textwrap.indent(str(item[2]), ' ').lstrip()
283
+ yield ' - ' + _('Yes') if item[3] else ' -'
281
284
 
282
285
  if 'example' in schema or 'examples' in schema:
283
286
  N = 1
@@ -289,7 +292,8 @@ def _build(name, schema, entities, convert, options):
289
292
  N += 1
290
293
  # validate the example against this schema
291
294
  try:
292
- validate(instance=ex, schema=schema)
295
+ if 'type' in schema:
296
+ validate(instance=ex, schema=schema)
293
297
  yield ''
294
298
  yield '.. code-block:: json'
295
299
  yield ''
@@ -1 +0,0 @@
1
- import sys, types, os;has_mfs = sys.version_info > (3, 5);p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('sphinxcontrib',));importlib = has_mfs and __import__('importlib.util');has_mfs and __import__('importlib.machinery');m = has_mfs and sys.modules.setdefault('sphinxcontrib', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('sphinxcontrib', [os.path.dirname(p)])));m = m or sys.modules.setdefault('sphinxcontrib', types.ModuleType('sphinxcontrib'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p)
@@ -1 +0,0 @@
1
- sphinxcontrib