You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when entering the swagger-ui.html page and trying to get the documentation by click on the link:
it looks like this:
"DownloadDocument": {
"required": [
"documentContent",
"documentMetaData"
],
"type": "object",
"properties": {
"documentMetaData": {
"$ref": "#/components/schemas/DocumentMetaData"
}, "documentContent": {
"type": "array",
"items": {
"type": "string",
"format": "byte"
}
}
The document content which is a byte[] is documented as an array of byte[] and when using this description in other app to generate an api client it generates a List<byte[]>.
I would expect the following format also in the OpenApi Specification:
"documentContent": {
"type": "string",
"format": "byte"
}**
Can you please advice if this is a bug or if not how can be resolved?
The text was updated successfully, but these errors were encountered:
I am using the following versions:
<springdoc-openapi-ui.version>1.5.9</springdoc-openapi-ui.version>
<swagger-annotations.version>1.5.22</swagger-annotations.version> and
openapi-generator-maven-plugin
4.3.1
Hi,
Thanks for reaching out here. My guess is that this comes down to the way
Swagger handles these kinds of properties so maybe the code generation
needs to apply some other annotations to these properties.
But actually I think what you get from clicking the link in the Swagger UI
is a runtime rendering rather than something generated by the
swagger-maven-plugin? Or do you use the plugin to generate a file to be
served at runtime by your Spring application?
And some other apps are using this json definition to generate a client to reach our API.
And because the field is wrong described the plugin generates the following model
Describe the bug
I generate a java class from a yaml file describing the model.
I have the following model described in the yaml file:
Document:
required:
- documentMetaData
- documentContent
type: "object"
properties:
documentMetaData:
$ref: "#/definitions/DocumentMetaData"
description: "Document type information"
documentContent:
type: string
format: byte
description: "Base64 encoded document content"
This generates the following class which is ok:
public class DownloadDocument {
@JsonProperty("documentMetaData")
private DocumentMetaData documentMetaData;
@JsonProperty("documentContent")
private byte[] documentContent;
But when entering the swagger-ui.html page and trying to get the documentation by click on the link:
it looks like this:
"DownloadDocument": {
"required": [
"documentContent",
"documentMetaData"
],
"type": "object",
"properties": {
"documentMetaData": {
"$ref": "#/components/schemas/DocumentMetaData"
},
"documentContent": {
"type": "array",
"items": {
"type": "string",
"format": "byte"
}
}
The document content which is a byte[] is documented as an array of byte[] and when using this description in other app to generate an api client it generates a List<byte[]>.
I would expect the following format also in the OpenApi Specification:
"documentContent": {
"type": "string",
"format": "byte"
}**
Can you please advice if this is a bug or if not how can be resolved?
The text was updated successfully, but these errors were encountered: