use of com.fasterxml.classmate.TypeResolver 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()));
}
use of com.fasterxml.classmate.TypeResolver in project dropwizard by dropwizard.
the class SelfValidatingValidatorTest method getMethod.
private ResolvedMethod getMethod(String name, Class<?>... params) {
AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration.StdConfiguration(AnnotationInclusion.INCLUDE_AND_INHERIT_IF_INHERITED);
TypeResolver typeResolver = new TypeResolver();
MemberResolver memberResolver = new MemberResolver(typeResolver);
ResolvedTypeWithMembers annotatedType = memberResolver.resolve(typeResolver.resolve(InvalidExample.class), annotationConfiguration, null);
for (ResolvedMethod m : annotatedType.getMemberMethods()) {
if (hasSignature(m, name, params)) {
return m;
}
}
throw new IllegalStateException("Could not resolve method " + name + Arrays.toString(params) + " in " + InvalidExample.class);
}
Aggregations