本文整理了Java中io.swagger.models.Swagger.getTags()
方法的一些代码示例,展示了Swagger.getTags()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.getTags()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:getTags
暂无
代码示例来源:origin: Swagger2Markup/swagger2markup
pathOperations.forEach(operation -> buildOperation(markupDocBuilder, operation, config));
} else if (config.getPathsGroupedBy() == GroupBy.TAGS) {
Validate.notEmpty(context.getSwagger().getTags(), "Tags must not be empty, when operations are grouped by tags");
Map<String, Tag> tagsMap = TagUtils.toSortedMap(context.getSwagger().getTags(), config.getTagOrdering());
代码示例来源:origin: kongchen/swagger-maven-plugin
private void updateTagDescriptions(Map<String, Tag> discoveredTags) {
if (swagger.getTags() != null) {
for (Tag tag : swagger.getTags()) {
Tag rightTag = discoveredTags.get(tag.getName());
if (rightTag != null && rightTag.getDescription() != null) {
tag.setDescription(rightTag.getDescription());
}
}
}
}
代码示例来源:origin: Swagger2Markup/swagger2markup
/**
* Builds the overview MarkupDocument.
*
* @return the overview MarkupDocument
*/
@Override
public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, OverviewDocument.Parameters params) {
Swagger swagger = params.swagger;
Info info = swagger.getInfo();
buildDocumentTitle(markupDocBuilder, info.getTitle());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder));
buildOverviewTitle(markupDocBuilder, labels.getLabel(Labels.OVERVIEW));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder));
buildDescriptionParagraph(markupDocBuilder, info.getDescription());
buildVersionInfoSection(markupDocBuilder, info);
buildContactInfoSection(markupDocBuilder, info.getContact());
buildLicenseInfoSection(markupDocBuilder, info);
buildUriSchemeSection(markupDocBuilder, swagger);
buildTagsSection(markupDocBuilder, swagger.getTags());
buildConsumesSection(markupDocBuilder, swagger.getConsumes());
buildProducesSection(markupDocBuilder, swagger.getProduces());
buildExternalDocsSection(markupDocBuilder, swagger.getExternalDocs());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_AFTER, markupDocBuilder));
return markupDocBuilder;
}
代码示例来源:origin: kongchen/swagger-maven-plugin
if (swagger.getTags() != null) {
Collections.sort(swagger.getTags(), new Comparator<Tag>() {
public int compare(final Tag a, final Tag b) {
return a.toString().toLowerCase().compareTo(b.toString().toLowerCase());
代码示例来源:origin: com.reprezen.genflow/swagger-doc
public Tag getModelTag(final String tagName) {
List<Tag> _tags = this.swagger.getTags();
for (final Tag tag : _tags) {
String _name = tag.getName();
boolean _equals = Objects.equal(_name, tagName);
if (_equals) {
return tag;
}
}
return null;
}
}
代码示例来源:origin: vmware/admiral
/**
* Add the service's tags to Swagger.
*
* @param clazz The service class
*/
private void setTags(Class<?> clazz) {
if (this.swagger.getTags() == null) {
this.swagger.setTags(new LinkedList<>());
}
this.swagger.getTags().addAll(getApiTagsAsList(clazz));
}
代码示例来源:origin: com.reprezen.genflow/swagger-doc
public LinkedHashSet<String> reorderTags(final Collection<String> tags) {
LinkedHashSet<String> _xblockexpression = null;
{
final LinkedHashSet<String> orderedTags = Sets.<String>newLinkedHashSet();
final Function1<Tag, String> _function = (Tag it) -> {
return it.getName();
};
Iterable<String> _filterNull = IterableExtensions.<String>filterNull(ListExtensions.<Tag, String>map(this.swagger.getTags(), _function));
for (final String tag : _filterNull) {
boolean _contains = tags.contains(tag);
if (_contains) {
orderedTags.add(tag);
}
}
orderedTags.addAll(tags);
_xblockexpression = orderedTags;
}
return _xblockexpression;
}
代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v2-converter
public SwaggerInventory process(Swagger swagger) {
Iterator var2;
if(swagger.getTags() != null) {
var2 = swagger.getTags().iterator();
while(var2.hasNext()) {
Tag key = (Tag)var2.next();
this.process(key);
}
}
String key1;
if(swagger.getPaths() != null) {
var2 = swagger.getPaths().keySet().iterator();
while(var2.hasNext()) {
key1 = (String)var2.next();
Path model = swagger.getPath(key1);
this.process(model);
}
}
if(swagger.getDefinitions() != null) {
var2 = swagger.getDefinitions().keySet().iterator();
while(var2.hasNext()) {
key1 = (String)var2.next();
Model model1 = (Model)swagger.getDefinitions().get(key1);
this.process(model1);
}
}
return this;
}
代码示例来源:origin: swagger-api/swagger-parser
public SwaggerInventory process(Swagger swagger) {
Iterator var2;
if(swagger.getTags() != null) {
var2 = swagger.getTags().iterator();
while(var2.hasNext()) {
Tag key = (Tag)var2.next();
this.process(key);
}
}
String key1;
if(swagger.getPaths() != null) {
var2 = swagger.getPaths().keySet().iterator();
while(var2.hasNext()) {
key1 = (String)var2.next();
Path model = swagger.getPath(key1);
this.process(model);
}
}
if(swagger.getDefinitions() != null) {
var2 = swagger.getDefinitions().keySet().iterator();
while(var2.hasNext()) {
key1 = (String)var2.next();
Model model1 = (Model)swagger.getDefinitions().get(key1);
this.process(model1);
}
}
return this;
}
代码示例来源:origin: io.swagger.parser.v3/swagger-parser-v2-converter
public SwaggerInventory process(Swagger swagger) {
Iterator var2;
if(swagger.getTags() != null) {
var2 = swagger.getTags().iterator();
while(var2.hasNext()) {
Tag key = (Tag)var2.next();
this.process(key);
}
}
String key1;
if(swagger.getPaths() != null) {
var2 = swagger.getPaths().keySet().iterator();
while(var2.hasNext()) {
key1 = (String)var2.next();
Path model = swagger.getPath(key1);
this.process(model);
}
}
if(swagger.getDefinitions() != null) {
var2 = swagger.getDefinitions().keySet().iterator();
while(var2.hasNext()) {
key1 = (String)var2.next();
Model model1 = (Model)swagger.getDefinitions().get(key1);
this.process(model1);
}
}
return this;
}
代码示例来源:origin: outofcoffee/imposter
.append(ofNullable(specInfo.getDescription()).map(specDesc -> " - " + specDesc).orElse("")));
tags.addAll(getOrEmpty(spec.getTags()));
consumes.addAll(getOrEmpty(spec.getConsumes()));
produces.addAll(getOrEmpty(spec.getProduces()));
代码示例来源:origin: apache/cxf
if (replaceTags && data.getTags() != null) {
data.getTags().clear();
if (replaceTags && data.getTags() != null) {
Collections.sort(data.getTags(), new Comparator<Tag>() {
代码示例来源:origin: io.github.swagger2markup/swagger2markup
pathOperations.forEach(operation -> buildOperation(markupDocBuilder, operation, config));
} else if (config.getPathsGroupedBy() == GroupBy.TAGS) {
Validate.notEmpty(context.getSwagger().getTags(), "Tags must not be empty, when operations are grouped by tags");
Map<String, Tag> tagsMap = TagUtils.toSortedMap(context.getSwagger().getTags(), config.getTagOrdering());
代码示例来源:origin: com.reprezen.genflow/genflow-api
if (swagger.getTags() != null) {
for (Tag tag : swagger.getTags()) {
callbacks.tag(tag);
callbacks.any(tag);
代码示例来源:origin: swagger-api/swagger-parser
if (swagger.getTags() != null) {
openAPI.setTags(convertTags(swagger.getTags()));
代码示例来源:origin: io.swagger.parser.v3/swagger-parser-v2-converter
if (swagger.getTags() != null) {
openAPI.setTags(convertTags(swagger.getTags()));
代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v2-converter
if (swagger.getTags() != null) {
openAPI.setTags(convertTags(swagger.getTags()));
代码示例来源:origin: com.github.phillip-kruger/apiee-core
private Swagger createSwagger(final Set<Class<?>> classes,final URL url){
Swagger swagger = new Reader(new Swagger()).read(classes);
Info info = getSwaggerInfo(swagger);
if(info!=null)swagger.setInfo(info);
Map<String, SecuritySchemeDefinition> securityDefinitions = getSecurityDefinitions(swagger);
if(securityDefinitions!=null)swagger.setSecurityDefinitions(securityDefinitions);
String consumes = whiteLabel.getProperty(CONSUMES, null);
if(anyIsSet(consumes))swagger.setConsumes(toList(swagger.getConsumes(),consumes));
String produces = whiteLabel.getProperty(PRODUCES, null);
if(anyIsSet(produces))swagger.setProduces(toList(swagger.getProduces(),produces));
String basePath = whiteLabel.getProperty(BASE_PATH, getBasePath(swagger.getBasePath(), url));
if(anyIsSet(basePath))swagger.setBasePath(basePath);
String schemes = whiteLabel.getProperty(SCHEMES, url.getProtocol().toUpperCase());
if(anyIsSet(schemes))swagger.setSchemes(toSchemeList(swagger.getSchemes(),schemes));
String host = whiteLabel.getProperty(HOST, url.getHost() + DOUBLE_POINT + url.getPort());
if(anyIsSet(host))swagger.setHost(host);
String tags = whiteLabel.getProperty(TAGS, null);
if(anyIsSet(tags))swagger.setTags(toTagList(swagger.getTags(),tags));
return swagger;
}
代码示例来源:origin: com.reprezen.genflow/genflow-api
@Override
public void swagger(Swagger swagger) {
swagger.setSchemes(fillList(swagger.getSchemes()));
swagger.setConsumes(fillList(swagger.getConsumes()));
swagger.setProduces(fillList(swagger.getProduces()));
swagger.setPaths(fillMap(swagger.getPaths()));
swagger.setDefinitions(fillMap(swagger.getDefinitions()));
swagger.setParameters(fillMap(swagger.getParameters()));
swagger.setResponses(fillMap(swagger.getResponses()));
swagger.setSecurityDefinitions(fillMap(swagger.getSecurityDefinitions()));
swagger.setSecurity(fillList(swagger.getSecurity()));
swagger.setTags(fillList(swagger.getTags()));
}
代码示例来源:origin: io.github.swagger2markup/swagger2markup
/**
* Builds the overview MarkupDocument.
*
* @return the overview MarkupDocument
*/
@Override
public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, OverviewDocument.Parameters params) {
Swagger swagger = params.swagger;
Info info = swagger.getInfo();
buildDocumentTitle(markupDocBuilder, info.getTitle());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder));
buildOverviewTitle(markupDocBuilder, labels.getLabel(Labels.OVERVIEW));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder));
buildDescriptionParagraph(markupDocBuilder, info.getDescription());
buildVersionInfoSection(markupDocBuilder, info);
buildContactInfoSection(markupDocBuilder, info.getContact());
buildLicenseInfoSection(markupDocBuilder, info);
buildUriSchemeSection(markupDocBuilder, swagger);
buildTagsSection(markupDocBuilder, swagger.getTags());
buildConsumesSection(markupDocBuilder, swagger.getConsumes());
buildProducesSection(markupDocBuilder, swagger.getProduces());
buildExternalDocsSection(markupDocBuilder, swagger.getExternalDocs());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_AFTER, markupDocBuilder));
return markupDocBuilder;
}
内容来源于网络,如有侵权,请联系作者删除!