io.swagger.v3.oas.models.OpenAPI.setComponents()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(123)

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

OpenAPI.setComponents介绍

暂无

代码示例

代码示例来源:origin: swagger-api/swagger-core

openAPI.setComponents(components);

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

@SuppressWarnings("rawtypes")
protected void generateSpec() throws Exception
{
  Set<Class<?>> classes = this.registeredControllers;
  OpenAPIExtensions.setExtensions(Collections.singletonList(new ServerParameterExtension()));
  OpenAPI openApi = new OpenAPI();
  Info info = mapper.convertValue(openAPIConfig.getValue("info").unwrapped(), Info.class);
  openApi.setInfo(info);
  Map<String, SecurityScheme> securitySchemes = mapper.convertValue(    openAPIConfig.getValue("securitySchemes").unwrapped(),new TypeReference<Map<String, SecurityScheme>>(){});
  if (openApi.getComponents() == null)
  {
    openApi.setComponents(new Components());
  }
  openApi.getComponents().setSecuritySchemes(securitySchemes);
  List<Server> servers = mapper.convertValue(openAPIConfig.getValue("servers").unwrapped(), new TypeReference<List<Server>>(){});
  openApi.setServers(servers);
  SwaggerConfiguration config = new SwaggerConfiguration().resourceClasses(classes.stream().map(Class::getName).collect(Collectors.toSet())).openAPI(openApi);
  config.setModelConverterClassess(Collections.singleton(ServerModelResolver.class.getName()));
  OpenApiContext ctx = new GenericOpenApiContext().openApiConfiguration(config)
      .openApiReader(new Reader(config))
      .openApiScanner(new JaxrsApplicationAndAnnotationScanner().openApiConfiguration(config))
      .init();
  openApi = ctx.read();
  this.openApi = openApi;
  this.spec = writer.writeValueAsString(openApi);
}

代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v3

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v3

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

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

openAPI.setComponents(new Components());

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

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

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

openAPI.setComponents(new Components());

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

openAPI.setComponents(new Components());

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

openAPI.setComponents(new Components());

代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v3

openAPI.setComponents(new Components());

代码示例来源:origin: apache/cxf

configuration.getOpenAPI().setComponents(oas.getComponents());

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-service-description-openapi-v3

configuration.getOpenAPI().setComponents(oas.getComponents());

代码示例来源:origin: swagger-api/swagger-parser

openAPI.setComponents(new Components());

相关文章