Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
when started spring boot project ,the console print "Validator -ERROR [ModelSpecification.spec] At least one type of specification is required" , and I'm using latest version.how to fix it ?
Andrew Holland
@dilipkrish any reason why the https://github.com/webjars/swagger-ui couldnt be used rather than packaging this up in the build? this would allow the ui to be updated with the latest changes without a new release of springfox!
Harikesh Pallantla
hi all,
I am using sprinfox-boot-starter v3.0.0 and in swagger ui an endpoint /foo/{id} is missing but if I change the endpoint to /foo/{id}/ I am able to get it, can anyone tell me where I might go wrong.
1 reply
Dilip Krishnan
Can’t tell without a reproducible sample. @harikesh409
@a1dutch that’s because it has customizations that discover swagger endpoints so that you don’t have to type the endpoint in the ui.
Harikesh Pallantla

Can’t tell without a reproducible sample. @harikesh409

If I remove spring-boot-starter-data-rest this dependency it is working properly, I will deploy somewhere and give a sample if possible. Can you say if any dependency that might cause a conflict?

Dilip Krishnan
It’s very possible that something is causing that endpoint to go away from the documentation. Would be great if you have a working sample that shows it’s missing. I could then try and fix it.
can someone clarify for me how am I supposed to use Swagger with a Maven Project using only Servlets?
is it even possible?
Dilip Krishnan
Depends. SpringFox only supports spring based api discovery. If your application is completely hand written using servlets then you’re better off writing the open api docs by hand

public class HomeController extends HttpServlet {

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
UserDAO uDao = new UserDAO();
ArrayList<Customer> customers = null;


    try {

    } catch (SQLException throwables) {
    } finally {
        out.print(new Gson().toJson(customers));


well I tried my best to fit it all in
this is an example of one of the many endpoints in my project
the webservlet tag is the only javaee tag I'm making use of
@dilipkrish would you say in this instance its not worth to use Swagger? If its not would you mind directing me towards any other cool way I can document my api? thank you
Dilip Krishnan
In this particular case I’d check to see if swagger-core would support it. Tho I think that project is also geared towards jax-rs. My recommendation would be to use spring-rest-docs if you have tests that excercise this endpoint.

In this particular case I’d check to see if swagger-core would support it. Tho I think that project is also geared towards jax-rs. My recommendation would be to use spring-rest-docs if you have tests that excercise this endpoint.

would you mind clearing up for me what is JAX-RS? I seem to not be able to figure it out. I understand that JavaEE offers many way to write web apps easily, are Servlets part of JAX-RS?

Andrew Holland
Hi, is it possible to configure v3 to use swagger2 via the ui via properties? the ui keeps looking for /v3/api-docs
3 replies
Can Emre Ayar

Hi all,
I am using io.springfox 3.0.0 version in my project. I added the dependency to my build.gradle file as following:

implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'

The external libraries were created as expected:

I am using Spring Boot 2.4.2 and Java 11.

When I run my Spring boot application, I get the following error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'swagger2ControllerWebMvc' defined in URL [jar:file:/opt/rally/dynamicscreen-service/lib/springfox-swagger2.jar!/springfox/documentation/swagger2/web/Swagger2ControllerWebMvc.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jsonSerializer' defined in springfox.documentation.spring.web.SpringfoxWebConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [springfox.documentation.spring.web.json.JsonSerializer]: Factory method 'jsonSerializer' threw exception; nested exception is java.lang.NoClassDefFoundError: io/swagger/v3/oas/models/OpenAPI

Where could I be doing wrong?

I am using springdoc-openapi-webflux-ui (v1.5.6). I have a microservice with different endpoints.
I am not able to maintain the order of the endpoints (I dont want it to sort on alphabetically method or tags).
is there a way??
 @Operation(description = "first endpoint ", requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody())
Hello all ,
After updating io.springfox to version 3.0.0 in my spring boot project ... I remarked that the order of values of Enum used as parameter in a post method changed to asc alphabetic in api-docs
Do you know what could cause this ?
Thank you for your help :)
Vu Do
Hi guys. Is there anyway to change the style of an array request param? It was generating the style as form but now it turns into pipe delimited even though I haven't changed any settings.
I use spring fox 3.0
Sharath Kolibailu Venkatesh
Hi Guys. I see examples under requestBody are not being rendered in springfox swagger ui 3.x. RequestBody examples were shown before when I was using swagger ui 2.9.2. Any workaround suggested to tackle this out ?
thanks for your help.
Vu Do
Please use springdoc. springfox looks like it is no longer mantained
Andrew Winterman
@VuDo98 for real?
Dilip Krishnan
Looking for maintainers. To be honest
There is work going on. Just a little slow
Chamith Chathuka
Евгений Буйволов

Hello there! Does anyone knows why I can't see properties in my models in swagger ui?
public Docket docket() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(new ApiInfoBuilder()

@ApiModel(value = "EmployeeDTO", reference = "EmployeeDTO")
public class EmployeeDTO {
@ApiModelProperty(value = "val",
name = "name",
dataType = "UUID",
example = "0066920b-8a90-4bc6-8364-aeefe12a1b36")
UUID uuid;
@ApiModelProperty(value = "val",
name = "name",
dataType = "String",
example = "Name")
String name;

As result I see only empty schemas, idk why.

Also I tried to use @ApiResponses and @ApiResponse inside it, but i got empty responses, even if I do everything following docs. I tried to use Schema from v3.oas (because as I understood it allows to describe list of entities as response), but no success.
Евгений Буйволов
Sorry to distract you guys, I migrated to springdoc. Wish you good luck!
Hi folks, I got 503 Http Status from http://springfox.github.io/springfox/ , it was able to access in a few days ago
I found the problem , DNS pollution,AUTO DIRECT TO , It has been resloved。
Marcello de Sales
hi there... I'm writing a SpringBootTest that verifies if the service has a given set of Controller endpoints (Actuators, Platform, etc)
is there any event thrown from SpringFox when it finishes scanning all controllers of the app? Or any Bean holding the list of all APis?
List of all detected APIs
Angelo Capone
Hi, i'm using springfox 3 in a spring-boot 2.4 webflux based application. Is there any way to generate v2 api-docs?
Lance Hannestad

How can I use @ApiModelProperty to create an example value of null? This does not compile:

@ApiModelProperty(example = null)
public Long nullableField;

Is there some special String I can pass in to indicate that I want the value to be null, like with Spring's EL "#{null}"?

Vladimir Goncharov
Hello everyone! Please, tell me how to calculate the maximum value in the attributes to Swagger Schema? I tried the constant class with calc Float.MAX_VALUE, but I got the message: Attribute value must be constant
      minimum = "0",
      maximum = "Float.MAX_VALUE")
      Float param;

Morning! My rest API looks like this:

    @ApiOperation("Fetch all XXX belonging to an XXX.")
    public List<String> getXXX(@ApiParam("ID of XXX")
                                  @PathVariable("id") String id,
                                  @ApiParam("XXX XXX.")
                                  @RequestParam(required = false) Set<String> xxx) {

The generated Swagger file is:

            "name": "xxx",
            "in": "query",
            "description": "XXX XXX.",
            "required": false,
            "type": "string"

While I'm expecting a type "array" for parameter xxx. Do you know what I'm doing wrong? Thanks!

I'm trying to do the following but haven't been successful. I want to take a swagger.yaml and use it to generate the ../api-docs output and well as well as use it in swagger-ui. Is this possible?
Ahmed Bakran
Hey all, I am trying to incorporate swagger/openapi to my springboot app
Getting this error when trying to get to the json file: Ambiguous handler methods mapped for '/v3/api-docs': {public org.springframework.http.ResponseEntity springfox.documentation.oas.web.OpenApiControllerWebMvc.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest), public java.lang.String org.springdoc.webmvc.api.OpenApiWebMvcResource.openapiJson(javax.servlet.http.HttpServletRequest,java.lang.String,java.util.Locale) throws com.fasterxml.jackson.core.JsonProcessingException} at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:413) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:367) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.getHandlerInternal(RequestMappingInfoHandlerMapping.java:110) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.getHandlerInternal(RequestMappingInfoHandlerMapping.java:59) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:395) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1234) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1016) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE]
Jin Kwon
Does springfox-boot-starter actually supports DocumentationType.OAS_30?
Seems not.
Which one should I use @ApiOperaion or @Operation?
Hello , everyone , I have a OpenAPI object with extensions (key: "x-custom" , value: "123") , how can i write it to json like this { "x-custom":123} , not like this {"extentions":{"x-custom":123}}
are there any function to do the serialized openAPI with extensions ?

Hi guys,
I am using swagger v3.0 annotations with springboot application to auto-generate swagger documentation.

All APIs are showing on swagger-UI (<machine-ip>/swagger-ui/index.html) as expected, but file upload API had some issues, I have resolved them using @requestPart annotation, it is now showing up. but file attribute is mandatory so required(*) symbol is not showing up on swaggerUI.

@RequestPart(value = "file", required=true) final Multipart file
Despite of adding required property on file attribute still it is not showing required symbol.

Any help will be appreciated.