instrumenta / openapi2jsonschema

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

Problem with case-sensitive filesystem #40

Open rpgoldman opened 4 years ago

rpgoldman commented 4 years ago

I was running openapi2yaml on MacOS, and it generates files such as "query.json" for a component "Query" entity. But then it emits a reference form like "$ref": "Query.json" which causes problems with de-referencing.

Also, when I try to build a standalone JSON schema, I conjecture that this causes a problem. I see output like this:

Generating interpretation.json
An error occured processing interpretation: URLError: <urlopen error [Errno 2] No such file or directory: 'swagger/schemas/Query.json'>
rpgoldman commented 4 years ago

BTW, I'm not sure why, but when I installed this library with pip I got a version tagged as 0.9.1, but the version number in this repo is only 0.9.0, which seems. strange.

rpgoldman commented 4 years ago

It looks like the problem is created by downcasing the name of the component here: https://github.com/instrumenta/openapi2jsonschema/blob/d697cbff8a25f520e125e3a5f79cb4e9b972e8ce/openapi2jsonschema/command.py#L130

I'm not sure why this was done, though. Or, if it was done, why the reference in the emitted file wasn't also downcased.

yvesdm commented 3 years ago

Hit same issue lowercase of file names that don't match the referecend types in camelCase

yvesdm commented 3 years ago

This seems a duplicates of #20