instrumenta / openapi2jsonschema

Convert OpenAPI definitions into JSON schemas for all types in the API
Other
226 stars 87 forks source link

special characters are not allowed #60

Open visch opened 2 years ago

visch commented 2 years ago

When running against https://raw.githubusercontent.com/docusign/OpenAPI-Specifications/master/esignature.rest.swagger-v2.1.json (Note this was as of today at this time, I've attached a file which is a copy of the state of this file as of today) openapi2jsonschema https://raw.githubusercontent.com/docusign/OpenAPI-Specifications/master/esignature.rest.swagger-v2.1.json

Fails with

visch@visch-ubuntu:~/git/tap-docusign$ openapi2jsonschema https://raw.githubusercontent.com/docusign/OpenAPI-Specifications/master/esignature.rest.swagger-v2.1.json
Downloading schema
Parsing schema
Traceback (most recent call last):
  File "/home/visch/.local/bin/openapi2jsonschema", line 8, in <module>
    sys.exit(default())
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/click/core.py", line 610, in invoke    return callback(*args, **kwargs)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/openapi2jsonschema/command.py", line 68, in default
    data = yaml.load(response.read(), Loader=yaml.SafeLoader)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/yaml/__init__.py", line 112, in load
    loader = Loader(stream)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/yaml/loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/yaml/reader.py", line 79, in __init__
    self.determine_encoding()
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/yaml/reader.py", line 135, in determine_encoding
    self.update(1)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/yaml/reader.py", line 169, in update
    self.check_printable(data)
  File "/home/visch/.local/pipx/venvs/openapi2jsonschema/lib/python3.9/site-packages/yaml/reader.py", line 143, in check_printable
    raise ReaderError(self.name, position, ord(character),
yaml.reader.ReaderError: unacceptable character #x0080: special characters are not allowed

esignature.rest.swagger-v2.1.txt