How to add Properties[] properties in @Schema annotation?
Hi. Objective: I want multiple file-select buttons on swagger UI to upload a files as a request parts of a multipart request. The following swagger config would do what I want/need: "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file_a": { "type": "string", "format": "binary" }, "file_b": { "type": "string", "format": "binary" } } } } } Question: How can I use @Schema annotation (or any other) to generate such a swagger config? Using annotation, this is as far as I get: @Operation( requestBody = @RequestBody( content = @Content( mediaType = MediaType.MULTIPART_FORM_DATA_VALUE, schema = @Schema( type = "object" // -> properties[] is missing !!! ) )) ) @Schema does not seem to provide an means to add an properties[]. What am I missing? :( Thanks, -Stefan1.5KViews0likes2CommentsHow to define response type of a templated object
Let's say I have a `Pagination<T>` type to be used for my list endpoints. Now let's say I have `/Users` and this should return `Pagination<User>`. How do I define the response? Doing this is only partially: responses: 200: description: OK content: application/json; charset=utf-8: schema: $ref: '#/components/schemas/Pagination' This has no idea what the type of pagination is. I'm using Swagger annotations to generate this, and so I'd like to keep the solution working with annotation. I know I can probably create a custom component, something like UserList: type: object properties: result: type: array items: $ref: '#/components/schemas/User' meta: $ref: '#/components/schemas/PagingMetadata' And then update the above to reference this object, but I manually made this myself inside the .yaml file and I'd like to keep the solution working with annotations.