Yelp / bravado-core

Other
109 stars 98 forks source link

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

Closed nickgaya closed 4 years ago

nickgaya commented 4 years ago

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 commented 4 years ago

Coverage Status

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

nickgaya commented 4 years ago

@macisamuele, @lucafavatella: Any thoughts on this?

sjaensch commented 4 years ago

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.