0

i am going to validate my swagger (v2) documentation in http://editor.swagger.io/#/ but i got follow warning message.

{ "generalSwaggerWarnings": [ { "swaggerObject": "#/definitions/Future«object»", "message": "Definition is defined but is not used: #/definitions/Future«object»" } ] }

ERK
  • 344
  • 6
  • 27
  • Try using an Alternate Type Rule. You can see an example with this [post](https://github.com/swagger-api/swagger-core/issues/498#issuecomment-205718626) and the SpringFox [documentation](https://springfox.github.io/springfox/docs/current/#dependencies) Section 2.1.3 #10. – Khai Dinh Oct 04 '16 at 14:01

1 Answers1

2

Your scenario is a slight bit different than the example links I posted in my comment since you are not using the nested ResponseEntity. So your implementation would be something more like this:

import static springfox.documentation.schema.AlternateTypeRules.newRule;

...

    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .alternateTypeRules(
                        newRule(typeResolver.resolve(Future.class),
                                typeResolver.resolve(WildcardType.class)))
                ;
    }
Khai Dinh
  • 476
  • 3
  • 6