sc-oa 0.7.0.14__py3-none-any.whl → 0.7.0.16__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,20 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: sc-oa
3
- Version: 0.7.0.14
3
+ Version: 0.7.0.16
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
- Author: Ihor Kalnytskyi
7
- Requires-Dist: sphinx
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
- Requires-Dist: setuptools
15
-
16
- Olivier Heurtier
17
- Author-email: ihor@kalnytskyi.com
6
+ Author: Olivier Heurtier
7
+ Author-email: olivier.heurtier@github.com
18
8
  License: BSD
19
9
  Classifier: Topic :: Documentation
20
10
  Classifier: Topic :: Documentation :: Sphinx
@@ -43,3 +33,4 @@ Requires-Dist: m2r2
43
33
  Requires-Dist: picobox
44
34
  Requires-Dist: deepmerge
45
35
  Requires-Dist: setuptools
36
+ Dynamic: license-file
@@ -1,10 +1,11 @@
1
+ sc_oa-0.7.0.16.dist-info/licenses/LICENSE,sha256=Fe9eBZy-tUN-UOMSVfcr4c-MWpuWa4gTKTqH-kSeck4,1319
1
2
  sphinxcontrib/__init__.py,sha256=Es10gRADmbGSJZnYYmhfgA_2QzHQDmhj0IAft3kS1Og,259
2
3
  sphinxcontrib/openapi/__init__.py,sha256=x8cvrnXGqjZSc62nkeZC0KdCcCSXQY8uxv1kFhrPM18,3088
3
4
  sphinxcontrib/openapi/__main__.py,sha256=cp8p7qGn8nH2W_aeD9sMTuqPwLV3ys8DtLYZnyF29pY,2436
4
5
  sphinxcontrib/openapi/_lib2to3.py,sha256=mU2Dx78xEyiz0cfcj3R9eqiwHbCfspK5cDJ5ZwwQdA4,13624
5
6
  sphinxcontrib/openapi/directive.py,sha256=J4T0n_KkM6SB1Mr9GeYCVqWZNp3BMSjEnVvLvwj8CoM,2059
6
7
  sphinxcontrib/openapi/openapi20.py,sha256=FDdlcRIYKCynOZUjxQNoE8lCFRrZinmYu1khz8D18ZU,8984
7
- sphinxcontrib/openapi/openapi30.py,sha256=HzFLza9Z3D7smDYfru0CPWLBK4dle5uuWZgNNqlFqtE,29056
8
+ sphinxcontrib/openapi/openapi30.py,sha256=tW5pZoP-lR8ZUrwCsKDB_DXdOzoMdyYL1Irjd6mwdBM,29132
8
9
  sphinxcontrib/openapi/schema_utils.py,sha256=pxdB5qSTAtiCFmmF04R0zlOOG-Dxi98qwrA2uLZcNXA,4446
9
10
  sphinxcontrib/openapi/utils.py,sha256=oRWNDb_5KWTXOVblFgvrLvmGATae8C7PYvk1xc464vY,4343
10
11
  sphinxcontrib/openapi/locale/openapi.pot,sha256=sGo7dIRUUS6Ne4MRIU7PCphOoQG1AORgZhwwpD0nRfo,3831
@@ -16,11 +17,10 @@ sphinxcontrib/openapi/renderers/__init__.py,sha256=8hdY-sLK5kDbOL8Tqe55xEBphPFXV
16
17
  sphinxcontrib/openapi/renderers/_description.py,sha256=FAklhEaMksCYU5bno3SO0RuQCcwVTXbqPmPN3PrRlTM,702
17
18
  sphinxcontrib/openapi/renderers/_httpdomain.py,sha256=qx6pIVQF2BKWjrL1YOap1_2odtLAqk5SeuktofdOMRQ,24546
18
19
  sphinxcontrib/openapi/renderers/_httpdomain_old.py,sha256=aiWafD8LdRmCtG6ewkU3xF-P1oWxxYxUNzdcUFW4hB4,2632
19
- sphinxcontrib/openapi/renderers/_model.py,sha256=BapmKIHTXpS14huRUicz2rUxilaDau3uBOv-fsQ1mtE,15098
20
+ sphinxcontrib/openapi/renderers/_model.py,sha256=yoU265jAgkiW_Ew4EFiWuzA8Q56AsmYa4HBODJDA2bw,15441
20
21
  sphinxcontrib/openapi/renderers/_toc.py,sha256=0cVLyKJBcu4ULkiBdlQ-oMBWV4DVCVM5-BgT07xG0Fc,1478
21
22
  sphinxcontrib/openapi/renderers/abc.py,sha256=-irO9yVoHeygaMieq4DZMmWD0B5DkDu2mKuenGYopTI,1485
22
- sc_oa-0.7.0.14.dist-info/LICENSE,sha256=Fe9eBZy-tUN-UOMSVfcr4c-MWpuWa4gTKTqH-kSeck4,1319
23
- sc_oa-0.7.0.14.dist-info/METADATA,sha256=0pId_xn_yRypsI3Xww4rGPLlWyZknxn9E0o1xC7f8b0,1551
24
- sc_oa-0.7.0.14.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
25
- sc_oa-0.7.0.14.dist-info/top_level.txt,sha256=VJrV3_vaiKQVgVpR0I1iecxoO0drzGu-M0j40PVP2QQ,14
26
- sc_oa-0.7.0.14.dist-info/RECORD,,
23
+ sc_oa-0.7.0.16.dist-info/METADATA,sha256=-slypLDLtwQjPS6hf10JVBTE1Fwic_tZUAmPrlV-ORM,1360
24
+ sc_oa-0.7.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ sc_oa-0.7.0.16.dist-info/top_level.txt,sha256=VJrV3_vaiKQVgVpR0I1iecxoO0drzGu-M0j40PVP2QQ,14
26
+ sc_oa-0.7.0.16.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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 ''