Skip to content

fix: properly support JSON OpenAPI documents and config files [#488, #509, #515]. Thanks @tardyp and @Gelbpunkt! #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 16, 2021

Conversation

dbanty
Copy link
Collaborator

@dbanty dbanty commented Oct 16, 2021

Adapted from #509, fixes #488. The YAML parsing library we use only supports YAML 1.1, which was not yet a superset of JSON. As a result, certain JSON features (like tabs as white space) are not working. This fixes that problem by using the builtin json module for reading JSON files (after guessing the file type from file extension or mime type).

tardyp and others added 4 commits October 11, 2021 20:57
json is not technically a subset of yaml because yaml don't support tabs while json does

Signed-off-by: Pierre Tardy <[email protected]>
json is not exactly a subset of yaml, as yaml do not support tabs
there are maybe other subtleties, so we just use content-type to figure out how to parse

Signed-off-by: Pierre Tardy <[email protected]>
@dbanty dbanty added this to the 0.10.6 milestone Oct 16, 2021
@dbanty dbanty changed the title fix: properly support JSON OpenAPI documents and config files [#488, #509]. Thanks @tardyp and @Gelbpunkt! fix: properly support JSON OpenAPI documents and config files [#488, #509, #515]. Thanks @tardyp and @Gelbpunkt! Oct 16, 2021
@codecov
Copy link

codecov bot commented Oct 16, 2021

Codecov Report

Merging #515 (5040dcc) into main (a46c05a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #515   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           48        48           
  Lines         1610      1628   +18     
=========================================
+ Hits          1610      1628   +18     
Impacted Files Coverage Δ
openapi_python_client/__init__.py 100.00% <100.00%> (ø)
openapi_python_client/config.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a46c05a...5040dcc. Read the comment docs.

@dbanty dbanty merged commit b01db03 into main Oct 16, 2021
@dbanty dbanty deleted the yamljson branch October 16, 2021 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't generate new project with OpenAPI JSON file
2 participants