本文整理了Java中io.swagger.models.Swagger.info()
方法的一些代码示例,展示了Swagger.info()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.info()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:info
暂无
代码示例来源:origin: rakam-io/rakam
.url("http://www.apache.org/licenses/LICENSE-2.0.html"));
Swagger swagger = new Swagger().info(info)
.basePath("/")
.tags(ImmutableList.copyOf(tags))
代码示例来源:origin: yahoo/elide
/**
* @param dictionary The entity dictionary
* @param info Basic service information that cannot be generated
*/
public SwaggerBuilder(EntityDictionary dictionary, Info info) {
this.dictionary = dictionary;
globalResponses = new HashMap<>();
globalParams = new HashSet<>();
allClasses = new HashSet<>();
filterOperators = Sets.newHashSet(
Operator.IN,
Operator.NOT,
Operator.INFIX,
Operator.PREFIX,
Operator.POSTFIX,
Operator.GE,
Operator.GT,
Operator.LE,
Operator.LT,
Operator.ISNULL,
Operator.NOTNULL
);
swagger = new Swagger();
swagger.info(info);
}
代码示例来源:origin: io.swagger/swagger-jaxrs
@Override
public Swagger configure(Swagger swagger) {
if (schemes != null) {
for (String scheme : schemes) {
swagger.scheme(Scheme.forValue(scheme));
}
}
if (filterClass != null) {
try {
SwaggerSpecFilter filter = (SwaggerSpecFilter) Class.forName(filterClass).newInstance();
if (filter != null) {
FilterFactory.setFilter(filter);
}
} catch (Exception e) {
LOGGER.error("failed to load filter", e);
}
}
return swagger.info(info)
.host(host)
.basePath(basePath);
}
}
代码示例来源:origin: org.onap.ccsdk.apps.controllerblueprints/service
/**
* This is a generateSwagger
*
* @return String
*/
public String generateSwagger() {
Swagger swagger = new Swagger().info(getInfo());
swagger.setPaths(getPaths());
swagger.setDefinitions(getDefinition());
return swagger.toString();
}
代码示例来源:origin: de.taimos/spring-cxf-daemon
protected synchronized Swagger scan() {
Set<Class<?>> classes = this.scanner.classes();
if (classes != null) {
final DefaultReaderConfig rc = new DefaultReaderConfig();
rc.setScanAllResources(true);
Reader reader = new Reader(null, rc);
Swagger swagger = reader.read(classes);
this.configureServerURL(swagger);
swagger.info(this.createInfo());
if (this.config != null) {
swagger = this.config.configure(swagger);
}
this.swaggerCache.compareAndSet(null, swagger);
}
return this.swaggerCache.get();
}
代码示例来源:origin: io.syndesis.server/server-connector-generator
@Test
public void shouldDetermineConnectorName() {
final Swagger swagger = new Swagger();
assertThat(generator.determineConnectorName(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
final Info info = new Info();
swagger.info(info);
assertThat(generator.determineConnectorName(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
info.title("title");
assertThat(generator.determineConnectorName(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("title");
}
代码示例来源:origin: io.syndesis.server/server-api-generator
@Test
public void shouldDetermineConnectorDescription() {
final Swagger swagger = new Swagger();
assertThat(generator.determineConnectorDescription(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
final Info info = new Info();
swagger.info(info);
assertThat(generator.determineConnectorDescription(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
info.description("description");
assertThat(generator.determineConnectorDescription(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("description");
}
代码示例来源:origin: io.syndesis.server/server-api-generator
@Test
public void shouldDetermineConnectorName() {
final Swagger swagger = new Swagger();
assertThat(generator.determineConnectorName(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
final Info info = new Info();
swagger.info(info);
assertThat(generator.determineConnectorName(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
info.title("title");
assertThat(generator.determineConnectorName(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("title");
}
代码示例来源:origin: io.syndesis.server/server-connector-generator
@Test
public void shouldDetermineConnectorDescription() {
final Swagger swagger = new Swagger();
assertThat(generator.determineConnectorDescription(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
final Info info = new Info();
swagger.info(info);
assertThat(generator.determineConnectorDescription(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("unspecified");
info.description("description");
assertThat(generator.determineConnectorDescription(SWAGGER_TEMPLATE, createSettingsFrom(swagger))).isEqualTo("description");
}
代码示例来源:origin: outbrain/ob1k
private Swagger buildSwagger(final Request request) {
final Swagger swagger = new Swagger();
swagger.host(request.getHeader("Host"));
swagger.info(buildInfo());
代码示例来源:origin: com.outbrain.swinfra/ob1k-swagger
private Swagger buildSwagger(final Request request) {
final Swagger swagger = new Swagger();
swagger.host(request.getHeader("Host"));
swagger.info(buildInfo());
代码示例来源:origin: io.swagger/swagger-jaxrs
@Override
public Swagger configure(Swagger swagger) {
if (swagger != null) {
Info info = swagger.getInfo();
if (info == null) {
swagger.info(new Info());
}
swagger.basePath(basePath)
.host(host)
.getInfo()
.title(title)
.version(apiVersion);
for(String scheme : this.schemes) {
swagger.scheme(Scheme.forValue(scheme));
}
}
return swagger;
}
}
代码示例来源:origin: pravega/pravega
@Override
public void init(ServletConfig config) throws ServletException {
Info info = new Info()
.title("Swagger Server")
.description("List of admin REST APIs for the pravega controller service.")
.termsOfService("")
.contact(new Contact()
.email(""))
.license(new License()
.name("Apache 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0"));
ServletContext context = config.getServletContext();
Swagger swagger = new Swagger().info(info);
new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-rest-api
protected void init() {
Pair<List<Tag>, Map<String, Path>> tagsAndPaths = generatePaths();
swagger = new Swagger()
.host(getHost())
.basePath(getBasePath())
.consumes(APPLICATION_JSON_VALUE)
.produces(APPLICATION_JSON_VALUE)
.info(generateInfo())
.tags(tagsAndPaths.getFirst())
.paths(tagsAndPaths.getSecond());
swagger.setParameters(parameters);
swagger.setDefinitions(definitions);
}
代码示例来源:origin: io.swagger/swagger-parser
if(obj != null) {
Info info = info(obj, "info", result);
swagger.info(info);
代码示例来源:origin: io.swagger/swagger-compat-spec-parser
.scheme(Scheme.forValue(scheme))
.basePath(basePath)
.info(info)
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
@Test
public void swaggerSerializeTest() {
final Info info = new Info().version("1.0.0").title("Swagger WebServices REST");
Swagger swagger = new Swagger().info(info).securityDefinition("basicAuth", new BasicAuthDefinition())
.scheme(Scheme.HTTP).consumes("application/json").produces("application/json");
final Model patientModel = ModelConverters.getInstance().read(Patient.class).get("Patient");
swagger.addDefinition("Patient", patientModel);
final String swaggerJson = Json.pretty(swagger);
assertNotNull(swaggerJson);
}
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
private void initSwagger() {
final Info info = new Info()
.version(OpenmrsConstants.OPENMRS_VERSION_SHORT)
.title("OpenMRS API Docs")
.description("OpenMRS RESTful API documentation generated by Swagger")
.contact(new Contact().name("OpenMRS").url("http://openmrs.org"))
.license(new License().name("MPL-2.0 w/ HD").url("http://openmrs.org/license"));
swagger
.info(info)
.host(this.host)
.basePath(this.basePath)
.schemes(this.schemes)
.securityDefinition("basic_auth", new BasicAuthDefinition())
.security(new SecurityRequirement().requirement("basic_auth"))
.consumes("application/json")
.produces("application/json")
.externalDocs(new ExternalDocs()
.description("Find more info on REST Module Wiki")
.url("https://wiki.openmrs.org/x/xoAaAQ"));
}
内容来源于网络,如有侵权,请联系作者删除!