We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If I use the class FileUpload in a Rest Service, it somehow overwrites the generated Openapi Specs.
I have a quarkus application where I defined a resource with two files in a multipart/form-data upload:
@Path("v1") public interface IMultiPartResource { @POST @Path("/multipart") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) Object multipart( @RequestBody( description = "The multipart data.", required = true, content = @Content( mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema( type = SchemaType.OBJECT, properties = { @SchemaProperty(name = "data1", type = SchemaType.STRING, format = "binary"), @SchemaProperty(name = "data2", type = SchemaType.STRING, format = "binary"), } ))) @NotNull @RestForm("data1") FileUpload data1, @RestForm("data2") Optional<FileUpload> data2, }
My Problem is, that the generated openapi spec is not correct. It produces something like:
--- ... /clv-api/v1/importer/gino-production-data: post: requestBody: description: "The multipart data." content: multipart/form-data: schema: type: object properties: data1: $ref: '#/components/schemas/FileUpload' data2: $ref: '#/components/schemas/FileUpload' required: true ... components: schemas: FileUpload: type: object
But I expect something like that:
--- ... /clv-api/v1/importer/gino-production-data: post: requestBody: description: "The multipart data." content: multipart/form-data: schema: type: object properties: data1: type: string format: binary data2: type: string format: binary required: true ... components: schemas: FileUpload: type: object
It works correctly, if a use the class "File".
For it to not overwrite the Openapi Specs, like how it is supposed to work.
See above.
No response
uname -a
ver
java -version
mvnw --version
gradlew --version
mvn --version Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f)
The text was updated successfully, but these errors were encountered:
/cc @EricWittmann (openapi), @MikeEdgar (openapi), @phillip-kruger (openapi)
Sorry, something went wrong.
#39950
Closing here. Duplicate
No branches or pull requests
Describe the bug
If I use the class FileUpload in a Rest Service, it somehow overwrites the generated Openapi Specs.
I have a quarkus application where I defined a resource with two files in a multipart/form-data upload:
My Problem is, that the generated openapi spec is not correct. It produces something like:
But I expect something like that:
It works correctly, if a use the class "File".
Expected behavior
For it to not overwrite the Openapi Specs, like how it is supposed to work.
Actual behavior
See above.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn --version
Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f)
Additional information
No response
The text was updated successfully, but these errors were encountered: