Search in sources :

Example 1 with AlternateTypeRule

use of springfox.documentation.schema.AlternateTypeRule in project thingsboard by thingsboard.

the class SwaggerConfiguration method thingsboardApi.

@Bean
public Docket thingsboardApi() {
    TypeResolver typeResolver = new TypeResolver();
    final ResolvedType jsonNodeType = typeResolver.resolve(JsonNode.class);
    final ResolvedType stringType = typeResolver.resolve(String.class);
    return new Docket(DocumentationType.SWAGGER_2).groupName("thingsboard").apiInfo(apiInfo()).alternateTypeRules(new AlternateTypeRule(jsonNodeType, stringType)).select().paths(apiPaths()).build().securitySchemes(newArrayList(jwtTokenKey())).securityContexts(newArrayList(securityContext()));
}
Also used : TypeResolver(com.fasterxml.classmate.TypeResolver) Docket(springfox.documentation.spring.web.plugins.Docket) ResolvedType(com.fasterxml.classmate.ResolvedType) AlternateTypeRule(springfox.documentation.schema.AlternateTypeRule) Bean(org.springframework.context.annotation.Bean)

Aggregations

ResolvedType (com.fasterxml.classmate.ResolvedType)1 TypeResolver (com.fasterxml.classmate.TypeResolver)1 Bean (org.springframework.context.annotation.Bean)1 AlternateTypeRule (springfox.documentation.schema.AlternateTypeRule)1 Docket (springfox.documentation.spring.web.plugins.Docket)1