本文整理了Java中io.swagger.models.Model.setTitle()
方法的一些代码示例,展示了Model.setTitle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.setTitle()
方法的具体详情如下:
包路径:io.swagger.models.Model
类名称:Model
方法名:setTitle
暂无
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-v2
private static boolean definePropertySetModel(Model model, String name, String description) {
return SwaggerResolutionContext.getSwagger().map(swagger -> {
// check already defined
if (!hasSchema(swagger, name)) {
// build and define
model.setTitle(name);
if (description != null) {
model.setDescription(description);
}
// add schema to include
SwaggerResolutionContext.getModels().ifPresent(schemas -> {
if (!schemas.containsKey(name)) {
schemas.put(name, model);
}
});
}
return true;
}).orElse(false);
}
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-v2
/**
* Get the {@link PropertyBox} type Schema from given type, if a {@link PropertySet} is available using a
* {@link PropertySetRef} annotation.
* @param type The type to resolve
* @param context Converter context
* @return Optional {@link PropertyBox} type Schema
*/
private static Optional<Model> getPropertyBoxSchema(Type type, ModelConverterContext context) {
return getPropertySet(type).map(ref -> PropertySetRefIntrospector.get().getPropertySet(ref))
.map(propertySet -> {
final Function<Type, io.swagger.models.properties.Property> resolver = t -> context
.resolveProperty(t, new Annotation[0]);
// check API model
return getPropertySetModel(type).map(apiModel -> {
final String name = apiModel.value().trim();
// define model
Model schema = buildPropertyBoxSchema(propertySet, resolver, false);
schema.setTitle(name);
if (AnnotationUtils.getStringValue(apiModel.description()) != null) {
schema.setDescription(apiModel.description());
}
context.defineModel(name, schema);
// return as ref
RefModel model = new RefModel(name);
return (Model) model;
}).orElseGet(() -> {
return buildPropertyBoxSchema(propertySet, resolver, false);
});
});
}
代码示例来源:origin: io.swagger/swagger-parser
model.setTitle(value);
内容来源于网络,如有侵权,请联系作者删除!