swagger-api / swagger.io-docs

The content of swagger.io
https://swagger.io/docs/
1.56k stars 401 forks source link

Incorrect format specified for type string. #273

Open lzemskov opened 4 years ago

lzemskov commented 4 years ago

This is from the following page: https://swagger.io/docs/specification/describing-responses/

ResponseThatReturnsAFile

Description above mentions type:string with format: binary or format: base64. The latter probably should be format: byte; i was not able to find format: base64 in the section around Data Types: https://swagger.io/specification/#dataTypes

hkosova commented 4 years ago

OpenAPI Specification is inconsistent on this point. It provides examples of format: base64 here and here, but does not explain how base64 is different from byte.

This issue is discussed in https://github.com/OAI/OpenAPI-Specification/issues/1547.

lzemskov commented 4 years ago

Thank you for the pointer. The comment on that thread seems to imply that there was suppose to be a meeting where the decision would have been made about byte vs base64

The comment i am referring to is from April 2018, almost 2 years ago: "As per @tsc meeting we are going make a decision between have a byte format or a base64 but not both. "

So if the decision has been made then it's probably worth-while updating the docs accordingly so not to have both formats, otherwise, as some of the other comments point out if feels weird and a bit inconsistent.

In either case this looks to be the same issue as discussed in the issue mentioned above so feel free to update this one make this as a 'Duplicate', 'Close' it or whatever proper flow.

Thanks

rattrayalex commented 2 years ago

Sounds like base64 should probably be used over byte, but that won't be added to the spec for 3.0.x because 3.1.x obviates the question.

Perhaps the docs should be changed to suggest base64 over byte, and maybe add a footnote for those wondering what byte is that it's ~equivalent to base64?