io.swagger.models.Swagger.setTags()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中io.swagger.models.Swagger.setTags()方法的一些代码示例,展示了Swagger.setTags()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.setTags()方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:setTags

Swagger.setTags介绍

暂无

代码示例

代码示例来源:origin: apache/servicecomb-java-chassis

private void convertTags(SwaggerDefinition definitionAnnotation, Swagger swagger) {
 if (definitionAnnotation.tags() == null) {
  return;
 }
 Stream<io.swagger.annotations.Tag> stream =
   Arrays.asList(definitionAnnotation.tags()).stream();
 List<Tag> tags = stream.map(this::convertTag).collect(Collectors.toList());
 swagger.setTags(tags);
}

代码示例来源:origin: io.swagger/swagger-models

public Swagger tags(List<Tag> tags) {
  this.setTags(tags);
  return this;
}

代码示例来源:origin: org.apache.servicecomb/swagger-generator-core

private void convertTags(SwaggerDefinition definitionAnnotation, Swagger swagger) {
 if (definitionAnnotation.tags() == null) {
  return;
 }
 Stream<io.swagger.annotations.Tag> stream =
   Arrays.asList(definitionAnnotation.tags()).stream();
 List<Tag> tags = stream.map(this::convertTag).collect(Collectors.toList());
 swagger.setTags(tags);
}

代码示例来源: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: org.ballerinalang/ballerina-to-swagger

/**
 * Creates tag swagger definition.
 *
 * @param annotationExpression The ballerina annotation attribute value for tag.
 * @param swagger              The swagger definition which the tags needs to be build on.
 */
private void createTagModel(BLangExpression annotationExpression, Swagger swagger) {
  if (null != annotationExpression) {
    List<Tag> tags = new LinkedList<>();
    BLangArrayLiteral tagArray = (BLangArrayLiteral) annotationExpression;
    for (ExpressionNode expr : tagArray.getExpressions()) {
      List<BLangRecordKeyValue> tagList = ((BLangRecordLiteral) expr).getKeyValuePairs();
      Map<String, BLangExpression> tagAttributes = ConverterUtils.listToMap(tagList);
      Tag tag = new Tag();
      if (tagAttributes.containsKey(ConverterConstants.ATTR_NAME)) {
        tag.setName(ConverterUtils.getStringLiteralValue(tagAttributes.get(ConverterConstants.ATTR_NAME)));
      }
      if (tagAttributes.containsKey(ConverterConstants.ATTR_DESCRIPTION)) {
        tag.setDescription(ConverterUtils
            .getStringLiteralValue(tagAttributes.get(ConverterConstants.ATTR_DESCRIPTION)));
      }
      tags.add(tag);
    }
    swagger.setTags(Lists.reverse(tags));
  }
}

代码示例来源:origin: Valandur/Web-API

List<String> integrationTags = new ArrayList<>();
swagger.setTags(new ArrayList<>());

代码示例来源:origin: outofcoffee/imposter

combined.setTags(tags);

代码示例来源:origin: noboomu/proteus

});
swagger.setTags(swaggerTags);

代码示例来源: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()));
}

相关文章