I’m trying to generate some web services definitions using Swagger Codegen » 2.2.1 All configs are working and the classes are generate correctly by my .yaml definitions. Why the property basePath is being ignored? My @RestController generate using only paths definition: Expected (using basePath and paths definitions): What am I doing wrong? Did I forget something? My .yaml contract: Answer
Tag: swagger
Swagger/OpenAPI annotations V3 – use Enum values in swagger annotations
I’m creating the the API description of our application using Swagger/OpenApi V3 annotations, imported from following dependency: One of the annotations is a @Schema annotation that accepts an attribute named allowableValues which allows a an array of strings: Now I would like to use a custom method constructed on our Enum class that returns the allowable strings array, so it
Hiding unimportant getter methods from swagger UI in Java [duplicate]
This question already has answers here: How to hide a parameter in swagger? (9 answers) Closed 27 days ago. I have two fields in my class startDate and endDate of LocalDateTime. Internally, these need to be returned as Optional<ZonedDateTime>, while in the query they are provided as LocalDateTimes. Swagger (Springfox v2.9.2) now shows the needed fields but also endDateWithTimezone.present and
Generate Unit Test Code from Swagger API for Java REST
I was trying using Swagger test templates and found this an interesting tool to generate the test files for my controllers, but It seems to just work for NodeJs projects, because there is not a similar tool for the Java platform. Do somebody knows about how to generate these Test files from my controllers by using a swagger file for
Unmarshalling query params into object using Swagger/Springfox and Spring Boot
I’ve got a search endpoint in my REST service. I’m using Spring Boot, so I’ve got a @RestController setup with a method that returns search results based on a search query. This is the method definition: I was hoping that SwaggerUI would show the SearchQuery’s fields as separate query params in the ui. It doesn’t; it just shows a generic
How to generate java client code for swagger REST API documentation
My scenario is the following. I have a swagger .json eg.: http://petstore.swagger.io/v2/swagger.json I want to use a generated java client for the REST API above, like: Expexted output: cica and the new pet is stored according to the REST API implmentation. I have successfully generated server stub for the petstore with the command: But this maven project code is a