Skip to content
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

Add option to automatically encode/decode strings with byte format #351

Merged
merged 4 commits into from
Oct 21, 2019

Conversation

nickgaya
Copy link
Contributor

Define a SwaggerFormat for the "byte" string format that base64-encodes binary data to wire and base64-decodes from wire to a Python bytes object.

This behavior is not backward-compatible so I added a config option to enable it, disabled by default.

Related: #146

@coveralls
Copy link

coveralls commented Oct 18, 2019

Coverage Status

Coverage increased (+0.002%) to 98.893% when pulling 2a0e6c0 on nickgaya:byte-format-base64 into 16e7529 on Yelp:master.

@nickgaya
Copy link
Contributor Author

@macisamuele, @lucafavatella: Any thoughts on this?

@sjaensch
Copy link
Contributor

This is great, thanks! We should probably default the config value to True in the next major release, and then start a deprecation process. Not using base64 goes against the spec.

@sjaensch sjaensch merged commit d9bc7c5 into Yelp:master Oct 21, 2019
@nickgaya nickgaya deleted the byte-format-base64 branch October 22, 2019 11:10
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.

3 participants