swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.36k stars 2.17k forks source link

Support proper mapping of the byte array #4659

Closed frantuma closed 2 months ago

frantuma commented 2 months ago

Includes and replaces https://github.com/swagger-api/swagger-core/pull/3955

Closes https://github.com/swagger-api/swagger-core/issues/3944 and https://github.com/swagger-api/swagger-core/issues/3511.

See also https://github.com/swagger-api/swagger-parser/issues/1630

It introduces binary-string-conversion env or system variable, allowing to define behavior for resolution and conversion of byte arrays:

binary-string-conversion = base64 : resolves into ByteArraySchema/BinarySchema using Base64 for casting/conversion binary-string-conversion = string-schema : resolves into StringSchema

RInverid commented 2 months ago

@frantuma Cool! one question: my current workaround for this issue is to annotate all endpoints returning byte[] as returning byte. Is this change compatible with this workaround? or will I need to pay attention when upgrading to the next version?

thanks a lot

frantuma commented 2 months ago

@RInverid it should be ok

spulci commented 1 month ago

@frantuma When we can expect this PR to be included in the next release?

Thanks

Simone

frantuma commented 1 month ago

@spulci released 2.2.22