congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
GenericOpenApiContext.openApiConfiguration
Code IndexAdd Tabnine to your IDE (free)

How to use
openApiConfiguration
method
in
io.swagger.v3.oas.integration.GenericOpenApiContext

Best Java code snippets using io.swagger.v3.oas.integration.GenericOpenApiContext.openApiConfiguration (Showing top 3 results out of 315)

origin: swagger-api/swagger-core

@Override
public OpenApiContext buildContext(boolean init) throws OpenApiConfigurationException {
  if (StringUtils.isBlank(ctxId)) {
    ctxId = OpenApiContext.OPENAPI_CONTEXT_ID_DEFAULT;
  }
  OpenApiContext ctx = OpenApiContextLocator.getInstance().getOpenApiContext(ctxId);
  if (ctx == null) {
    OpenApiContext rootCtx = OpenApiContextLocator.getInstance().getOpenApiContext(OpenApiContext.OPENAPI_CONTEXT_ID_DEFAULT);
    ctx = new GenericOpenApiContext()
        .openApiConfiguration(openApiConfiguration)
        .id(ctxId)
        .parent(rootCtx);
    if (ctx.getConfigLocation() == null && configLocation != null) {
      ((GenericOpenApiContext) ctx).configLocation(configLocation);
    }
    if (((GenericOpenApiContext) ctx).getResourcePackages() == null && resourcePackages != null) {
      ((GenericOpenApiContext) ctx).resourcePackages(resourcePackages);
    }
    if (((GenericOpenApiContext) ctx).getResourceClasses() == null && resourceClasses != null) {
      ((GenericOpenApiContext) ctx).resourceClasses(resourceClasses);
    }
    if (init) {
      ctx.init(); // includes registering itself with OpenApiContextLocator
    }
  }
  return ctx;
}
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: io.swagger.core.v3/swagger-integration

@Override
public OpenApiContext buildContext(boolean init) throws OpenApiConfigurationException {
  if (StringUtils.isBlank(ctxId)) {
    ctxId = OpenApiContext.OPENAPI_CONTEXT_ID_DEFAULT;
  }
  OpenApiContext ctx = OpenApiContextLocator.getInstance().getOpenApiContext(ctxId);
  if (ctx == null) {
    OpenApiContext rootCtx = OpenApiContextLocator.getInstance().getOpenApiContext(OpenApiContext.OPENAPI_CONTEXT_ID_DEFAULT);
    ctx = new GenericOpenApiContext()
        .openApiConfiguration(openApiConfiguration)
        .id(ctxId)
        .parent(rootCtx);
    if (ctx.getConfigLocation() == null && configLocation != null) {
      ((GenericOpenApiContext) ctx).configLocation(configLocation);
    }
    if (((GenericOpenApiContext) ctx).getResourcePackages() == null && resourcePackages != null) {
      ((GenericOpenApiContext) ctx).resourcePackages(resourcePackages);
    }
    if (((GenericOpenApiContext) ctx).getResourceClasses() == null && resourceClasses != null) {
      ((GenericOpenApiContext) ctx).resourceClasses(resourceClasses);
    }
    if (init) {
      ctx.init(); // includes registering itself with OpenApiContextLocator
    }
  }
  return ctx;
}
io.swagger.v3.oas.integrationGenericOpenApiContextopenApiConfiguration

Popular methods of GenericOpenApiContext

  • <init>
  • getOpenApiReader
  • id
  • parent
  • buildModelConverters
  • buildObjectMapperProcessor
  • buildReader
  • buildScanner
  • configLocation
  • getKnownLocations
  • getLocationLoaders
  • getOpenApiScanner
  • getLocationLoaders,
  • getOpenApiScanner,
  • getResourceClasses,
  • getResourcePackages,
  • init,
  • loadConfiguration,
  • mergeParentConfiguration,
  • openApiReader,
  • openApiScanner

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Runner (org.openjdk.jmh.runner)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now