Java Code Examples for com.fasterxml.classmate.TypeResolver#resolve()

The following examples show how to use com.fasterxml.classmate.TypeResolver#resolve() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SwaggerConfiguration.java    From Groza with Apache License 2.0 6 votes vote down vote up
@Bean
public Docket GrozaApi(){

    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("Groza")
            .apiInfo(apiInfo())
            .alternateTypeRules(
                    new AlternateTypeRule(
                            jsonNodeType,
                            stringType))
            .select()
            .paths(apiPaths())
            .build()
            .securitySchemes(newArrayList(jwtTokenKey()))
            .securityContexts(newArrayList(securityContext()));

}
 
Example 2
Source File: SwaggerConfiguration.java    From iotplatform with Apache License 2.0 6 votes vote down vote up
@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("iotp")
              .apiInfo(apiInfo())
              .alternateTypeRules(
                  new AlternateTypeRule(
                          jsonNodeType,
                          stringType))
              .select()
              .paths(apiPaths())
              .build()
              .securitySchemes(newArrayList(jwtTokenKey()))
              .securityContexts(newArrayList(securityContext()));
}
 
Example 3
Source File: SuccessPlugin.java    From BlogManagePlatform with Apache License 2.0 5 votes vote down vote up
public SuccessPlugin(TypeNameExtractor typeNameExtractor, TypeResolver typeResolver, SwaggerProperties properties) {
	this.typeNameExtractor = typeNameExtractor;
	this.typeResolver = typeResolver;
	this.useCustomerizedPluggins = properties.getUseCustomerizedPluggins();
	okMessage = SwaggerUtil.statusDescription((item) -> {
		return item.getStatus() == HttpStatus.OK;
	});
	ResponseMessageBuilder messageBuilder = new ResponseMessageBuilder();
	messageBuilder.code(HttpStatus.OK.value());
	messageBuilder.message(okMessage);
	messageBuilder.responseModel(new ModelRef(SwaggerModel.class.getSimpleName()));
	okResponses.add(messageBuilder.build());
	okResult = typeResolver.resolve(SwaggerModel.class);
}
 
Example 4
Source File: PageableParameterBuilderPlugin.java    From spring-cloud-gray with Apache License 2.0 4 votes vote down vote up
public PageableParameterBuilderPlugin(TypeNameExtractor nameExtractor, TypeResolver resolver) {
    this.nameExtractor = nameExtractor;
    this.resolver = resolver;
    this.pageableType = resolver.resolve(Pageable.class);
}
 
Example 5
Source File: PageableParameterBuilderPlugin.java    From albedo with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Autowired
public PageableParameterBuilderPlugin(TypeNameExtractor nameExtractor, TypeResolver resolver) {
	this.nameExtractor = nameExtractor;
	this.resolver = resolver;
	this.pageableType = resolver.resolve(Page.class);
}
 
Example 6
Source File: PageableParameterBuilderPlugin.java    From jhipster with Apache License 2.0 2 votes vote down vote up
/**
 * <p>Constructor for PageableParameterBuilderPlugin.</p>
 *
 * @param nameExtractor a {@link springfox.documentation.schema.TypeNameExtractor} object.
 * @param resolver a {@link com.fasterxml.classmate.TypeResolver} object.
 */
public PageableParameterBuilderPlugin(TypeNameExtractor nameExtractor, TypeResolver resolver) {
    this.nameExtractor = nameExtractor;
    this.resolver = resolver;
    this.pageableType = resolver.resolve(Pageable.class);
}