use of com.webcohesion.enunciate.api.ApiRegistrationContext in project enunciate by stoicflame.
the class SwaggerModule method getApiRegistry.
@Override
public ApiRegistry getApiRegistry() {
return new ApiRegistry() {
@Override
public List<ServiceApi> getServiceApis(ApiRegistrationContext context) {
return Collections.emptyList();
}
@Override
public List<ResourceApi> getResourceApis(ApiRegistrationContext context) {
return Collections.emptyList();
}
@Override
public Set<Syntax> getSyntaxes(ApiRegistrationContext context) {
return Collections.emptySet();
}
@Override
public InterfaceDescriptionFile getSwaggerUI() {
Set<String> facetIncludes = new TreeSet<String>(enunciate.getConfiguration().getFacetIncludes());
facetIncludes.addAll(getFacetIncludes());
Set<String> facetExcludes = new TreeSet<String>(enunciate.getConfiguration().getFacetExcludes());
facetExcludes.addAll(getFacetExcludes());
FacetFilter facetFilter = new FacetFilter(facetIncludes, facetExcludes);
ApiRegistrationContext context = new SwaggerRegistrationContext(facetFilter);
List<ResourceApi> resourceApis = apiRegistry.getResourceApis(context);
if (resourceApis == null || resourceApis.isEmpty()) {
info("No resource APIs registered: Swagger UI will not be generated.");
}
return new SwaggerInterfaceDescription(resourceApis, context);
}
};
}
Aggregations