[ https://issues.apache.org/jira/browse/CXF-8530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17838978#comment-17838978 ]
Andriy Redko commented on CXF-8530: ----------------------------------- Finally, the fix was merged! https://github.com/swagger-api/swagger-core/pull/3955 > Error in OpenAPI descriptor for byte array properties > ----------------------------------------------------- > > Key: CXF-8530 > URL: https://issues.apache.org/jira/browse/CXF-8530 > Project: CXF > Issue Type: Bug > Affects Versions: 3.4.3 > Reporter: Luca Leonardo Scorcia > Priority: Major > Attachments: repro.patch > > > When using OpenAPIFeature to generate the OpenAPIv3 description document for > a CXF web service, the built-in type mapper generates a wrong output in the > JSON document. > For repro, take the example project at > [https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3_web] > and add a byte[] property to the Item class, like in the attached patch file. > Run the project and scroll to the end of the generated json document at > [http://localhost:9000/app/openapi.json]: > {{"components" : {}} > {{ "schemas" : {}} > {{ "Item" : {}} > {{ "type" : "object",}} > {{ "properties" : {}} > {{ "name" : {}} > {{ "type" : "string"}} > {{ },}} > {{ "value" : {}} > {{ "type" : "string"}} > {{ },}} > {{ {color:#ff0000}"binary" : {{color}}} > {{{color:#ff0000} "type" : "array",{color}}} > {{{color:#ff0000} "items" : {{color}}} > {{{color:#ff0000} "type" : "string",{color}}} > {{{color:#ff0000} "format" : "byte"{color}}} > {{{color:#ff0000} }{color}}} > {{{color:#ff0000} }{color}}} > } > } > } > } > This is interpreted by OpenAPI codegen tools as a List of byte[]. > According to the OpenAPIv3 spec, byte arrays should actually be represented as > { > "type": "string", > "format": "byte" > } > without the "type": "array" wrapper. -- This message was sent by Atlassian Jira (v8.20.10#820010)