jhipster - Displaying APIs of Spring Data Rest -
after adding spring data rest jhipster generated project, how make rest apis viewable in addition of apis on controller level?
@repositoryrestresource(collectionresourcerel = "api/myentities", path = "api/myentites")
i try "/api/myentities".
in spring data rest, able see rest apis like
/api/myentities/search/<method name>
the following swaggerconfiguration class in project. don't see how can customize show apis spring data rest.
@configuration @enableswagger2 @profile("!"+constants.spring_profile_production) public class swaggerconfiguration implements environmentaware { private final logger log = loggerfactory.getlogger(swaggerconfiguration.class); public static final string default_include_pattern = "/api/.*"; private relaxedpropertyresolver propertyresolver; @override public void setenvironment(environment environment) { this.propertyresolver = new relaxedpropertyresolver(environment, "swagger."); } /** * swagger springfox configuration. */ @bean public docket swaggerspringfoxdocket() { log.debug("starting swagger"); stopwatch watch = new stopwatch(); watch.start(); docket docket = new docket(documentationtype.swagger_2) .apiinfo(apiinfo()) .genericmodelsubstitutes(responseentity.class) .forcodegeneration(true) .genericmodelsubstitutes(responseentity.class) .directmodelsubstitute(org.joda.time.localdate.class, string.class) .directmodelsubstitute(org.joda.time.localdatetime.class, date.class) .directmodelsubstitute(org.joda.time.datetime.class, date.class) .directmodelsubstitute(java.time.localdate.class, string.class) .directmodelsubstitute(java.time.zoneddatetime.class, date.class) .directmodelsubstitute(java.time.localdatetime.class, date.class) .select() .paths(regex(default_include_pattern)) .build(); watch.stop(); log.debug("started swagger in {} ms", watch.gettotaltimemillis()); return docket; } /** * api info appears on swagger-ui page. */ private apiinfo apiinfo() { return new apiinfo( propertyresolver.getproperty("title"), propertyresolver.getproperty("description"), propertyresolver.getproperty("version"), propertyresolver.getproperty("termsofserviceurl"), propertyresolver.getproperty("contact"), propertyresolver.getproperty("license"), propertyresolver.getproperty("licenseurl")); }
}
in xx.xx.config.apidoc.swaggerconfiguration.java
following default pattern include in swaggerconfiguration display api in administration tab.
public static final string default_include_pattern = "/api/.*";
and following line same class
.paths(regex(default_include_pattern))
added above pattern.
so can add 1 of own, examining spring data rest
api pattern. , add api pattern in paths()
function above one.
here talking jhipster 2.18.0
Comments
Post a Comment