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

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

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

Swagger.setDefinitions介绍

暂无

代码示例

代码示例来源:origin: blox/blox

@Override
 public void apply(Swagger swagger) {
  if (swagger.getDefinitions() != null) {
   swagger.setDefinitions(new TreeMap<>(swagger.getDefinitions()));
  }

  if (swagger.getPaths() != null) {
   swagger.setPaths(new TreeMap<>(swagger.getPaths()));
  }
 }
}

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

public static void appendDefinition(Swagger swagger, Map<String, Model> newDefinitions) {
 if (newDefinitions.isEmpty()) {
  return;
 }
 Map<String, Model> definitions = swagger.getDefinitions();
 if (definitions == null) {
  definitions = new LinkedHashMap<>();
  swagger.setDefinitions(definitions);
 }
 definitions.putAll(newDefinitions);
}

代码示例来源:origin: kongchen/swagger-maven-plugin

TreeMap<String, Model> defs = new TreeMap<String, Model>();
defs.putAll(swagger.getDefinitions());
swagger.setDefinitions(defs);

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

public static void appendDefinition(Swagger swagger, Map<String, Model> newDefinitions) {
 if (newDefinitions.isEmpty()) {
  return;
 }
 Map<String, Model> definitions = swagger.getDefinitions();
 if (definitions == null) {
  definitions = new LinkedHashMap<>();
  swagger.setDefinitions(definitions);
 }
 definitions.putAll(newDefinitions);
}

代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-v2

/**
 * Include current models in current Swagger, if any.
 */
public static void includeModels() {
  getSwagger().ifPresent(swagger -> {
    getModels().ifPresent(models -> {
      if (swagger.getDefinitions() == null) {
        swagger.setDefinitions(new LinkedHashMap<>());
      }
      for (Entry<String, Model> entry : models.entrySet()) {
        if (!swagger.getDefinitions().containsKey(entry.getKey())) {
          swagger.getDefinitions().put(entry.getKey(), entry.getValue());
        }
      }
    });
  });
}

代码示例来源: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: yahoo/elide

models.putAll(converters.readAll(clazz));
swagger.setDefinitions(models);

代码示例来源:origin: com.vmware.xenon/xenon-swagger

this.swagger.setDefinitions(this.modelRegistry.getDefinitions());

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

combined.setDefinitions(definitions);

代码示例来源:origin: org.ballerinalang/ballerina-to-swagger

if (!definitions.containsKey(ConverterConstants.ATTR_REQUEST)) {
  definitions.put(ConverterConstants.ATTR_REQUEST, messageModel);
  this.swaggerDefinition.setDefinitions(definitions);

代码示例来源:origin: FINRAOS/herd

swagger.setDefinitions(new TreeMap<>());
return swagger;

代码示例来源:origin: org.zalando.stups/swagger-codegen-common

getLog().info("MODEL-GENERATION DISABLED ...");
  System.setProperty("apis", "");
  swagger.setDefinitions(new HashMap<String, Model>(0));
} else if (!excludedModels.isEmpty()) {
  final Iterator<Entry<String, Model>> it = swagger.getDefinitions().entrySet().iterator();

代码示例来源: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

swagger.setDefinitions(definitions);

代码示例来源:origin: io.swagger/swagger-compat-spec-parser

swagger.setDefinitions(definitions);

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

相关文章