use of com.yahoo.elide.swagger.SwaggerBuilder in project elide by yahoo.
the class ElideAutoConfiguration method buildSwagger.
/**
* Creates a singular swagger document for JSON-API.
* @param elide Singleton elide instance.
* @param settings Elide configuration settings.
* @return An instance of a JPA DataStore.
*/
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(name = "elide.swagger.enabled", havingValue = "true")
@RefreshScope
public SwaggerController.SwaggerRegistrations buildSwagger(RefreshableElide elide, ElideConfigProperties settings) {
EntityDictionary dictionary = elide.getElide().getElideSettings().getDictionary();
Info info = new Info().title(settings.getSwagger().getName()).version(settings.getSwagger().getVersion());
SwaggerBuilder builder = new SwaggerBuilder(dictionary, info).withLegacyFilterDialect(false);
return new SwaggerController.SwaggerRegistrations(builder.build().basePath(settings.getJsonApi().getPath()));
}
use of com.yahoo.elide.swagger.SwaggerBuilder in project elide by yahoo.
the class ElideStandaloneSettings method buildSwagger.
/**
* Creates a singular swagger document for JSON-API.
* @param dictionary Contains the static metadata about Elide models. .
* @return list of swagger registration objects.
*/
default List<DocEndpoint.SwaggerRegistration> buildSwagger(EntityDictionary dictionary) {
Info info = new Info().title(getSwaggerName()).version(getSwaggerVersion());
SwaggerBuilder builder = new SwaggerBuilder(dictionary, info);
String moduleBasePath = getJsonApiPathSpec().replaceAll("/\\*", "");
Swagger swagger = builder.build().basePath(moduleBasePath);
List<DocEndpoint.SwaggerRegistration> docs = new ArrayList<>();
docs.add(new DocEndpoint.SwaggerRegistration("test", swagger));
return docs;
}
Aggregations