Skip to content

Default mapping of java byte array #3944

Closed
@lscorcia

Description

@lscorcia

Hi, I got bounced here from CXF Jira so I apologize in advance if it's not the right place to open this issue.

Basic repro project is here: https://github.com/apache/cxf/tree/cxf-3.4.3/distribution/src/main/release/samples/jax_rs/description_openapi_v3_web . Apply the attached patch file to expose the issue:
repro.txt.

I have a CXF/JAX-RS service that uses OpenAPIFeature to publish an OpenAPIv3 descriptor. As it's basically a duplicate of a SOAP Web Service, it does not have any annotation placed on its data types.
I am having troubles with fields of type byte[]. They are being represented in the descriptor as follows (see property called binary):

"components" : {
  "schemas" : {
    "Item" : {
      "type" : "object",
      "properties" : {
         "name" : {
            "type" : "string"
         },
         "value" : {
            "type" : "string"
         },
         "binary" : {
           "type" : "array",
           "items" : {
             "type" : "string",
             "format" : "byte"
           }
         }
       }
     }
   }
}

The byte array is wrapped in another array, which codegen tools parse as List of byte[] .
The correct representation for the parameter would be:

"binary": {     
  "type": "string",     
  "format": "byte" 
} 

Now, I understand I can annotate the hell out of these objects, but since the API perimeter is huge, it would mean a lot of work for something that should probably be working out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions