Skip to content

Added support for octet-stream content type (#116) #157

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 2 commits into from
Aug 13, 2020

Conversation

emann
Copy link
Collaborator

@emann emann commented Aug 13, 2020

Closes #116

@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #157 into main will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #157   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         1253      1262    +9     
=========================================
+ Hits          1253      1262    +9     
Impacted Files Coverage Δ
openapi_python_client/parser/responses.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 0230ec5...36b0bee. Read the comment docs.

@@ -101,6 +118,8 @@ def response_from_data(*, status_code: int, data: Union[oai.Response, oai.Refere
return Response(status_code=status_code)
if response_type == "array" and isinstance(schema_data.items, oai.Reference):
return ListRefResponse(status_code=status_code, reference=Reference.from_ref(schema_data.items.ref),)
if response_type == "string" and schema_data.schema_format in {"binary", "base64"}:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want "byte" instead of "base64" per OpenAPI spec. I don't think base64 is a standard format.

Suggested change
if response_type == "string" and schema_data.schema_format in {"binary", "base64"}:
if response_type == "string" and schema_data.schema_format in {"binary", "byte"}:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its byte for data and base64 for responses

@dbanty dbanty merged commit 9d517fe into openapi-generators:main Aug 13, 2020
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.

Content type octet-stream
2 participants