本文整理了Java中io.swagger.models.Swagger.consumes()
方法的一些代码示例,展示了Swagger.consumes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.consumes()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:consumes
暂无
代码示例来源:origin: jooby-project/jooby
swagger.consumes(MediaType.json.name());
} else if (consumes.size() == 1) {
swagger.consumes(consumes);
代码示例来源:origin: org.jooby/jooby-apitool
swagger.consumes(MediaType.json.name());
} else if (consumes.size() == 1) {
swagger.consumes(consumes);
代码示例来源: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
String s = getString(n, location + ".consumes", result);
if (s != null) {
swagger.consumes(s);
代码示例来源: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"));
}
内容来源于网络,如有侵权,请联系作者删除!