Closed
Description
Describe the bug
The generator expects a YAML file, and doesn't work with JSON files, despite all examples using JSON files.
To Reproduce
Steps to reproduce the behavior:
openapi-python-client generate --url https://raw.githubusercontent.com/Nadybot/Nadybot/unstable/html/api.json
- See error message about invalid YAML
Expected behavior
I expect it to load the file with JSON if YAML fails. openapi_python_client/__init__.py
in _get_document
only attempts to load with YAML, replacing yaml.safe_load(yaml_bytes)
with json.loads(yaml_bytes)
"fixes" this issue.
OpenAPI Spec File
https://raw.githubusercontent.com/Nadybot/Nadybot/unstable/html/api.json
Desktop (please complete the following information):
- OS: Fedora 34
- Python Version: 3.9.6
- openapi-python-client version 0.10.3