Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default mapping of java byte array #3944

Closed
lscorcia opened this issue Apr 27, 2021 · 2 comments · Fixed by #4659
Closed

Default mapping of java byte array #3944

lscorcia opened this issue Apr 27, 2021 · 2 comments · Fixed by #4659

Comments

@lscorcia
Copy link

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.

@WannabeSoftwareEngineer

Any update on this?

@ilopezv
Copy link

ilopezv commented Feb 7, 2024

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants