sphinx-contrib / openapi

OpenAPI (fka Swagger) spec renderer for Sphinx.
https://sphinxcontrib-openapi.readthedocs.io
BSD 2-Clause "Simplified" License
111 stars 80 forks source link

Build fails when resolving refs #119

Closed ddl-lgaddie closed 3 years ago

ddl-lgaddie commented 3 years ago

https://github.com/sphinx-contrib/openapi/blob/4f78db9c8ca2cefc4e4c1eeb46552a8d9d432855/sphinxcontrib/openapi/utils.py#L108

make html

...
reading sources... [ 45%] reference/monitor/api                             
Exception occurred:
  File "/usr/local/lib/python3.9/site-packages/sphinxcontrib/openapi/utils.py", line 108, in normalize_spec
    method.setdefault('parameters', [])
AttributeError: 'str' object has no attribute 'setdefault'
The full traceback has been saved in /var/folders/wh/w0_d38p56yz3fqwjj39tcnsw0000gp/T/sphinx-err-o1xngntb.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 2

reference/monitor/api.rst contains:

DMM Public APIs
===============

.. openapi:: /_static/api-specs/dmm-4.6/dmm.yaml
   :examples:

/_static/api-specs/dmm-4.6/dmm.yaml contains references like this one:

$ref: './drift_analyze.yaml#/components/schemas/driftAnalyzeRequest'

Where drift_analyze.yaml and other referenced files are in the same directory as dmm.yaml.

ddl-lgaddie commented 3 years ago

I should mention that my specs are OpenAPI version 3.0.3.

ddl-lgaddie commented 3 years ago

This is a duplicate of https://github.com/sphinx-contrib/openapi/issues/107.