public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException { if (classes != null && classes.size() != 0) { Set<Class<?>> resources = new LinkedHashSet(); classes.stream() .filter(c -> ignored.stream().noneMatch(i -> c.getName().startsWith(i))) .forEach(resources::add); if (!resources.isEmpty()) { // init context try { SwaggerConfiguration oasConfig = new SwaggerConfiguration() .resourceClasses(resources.stream().map(c -> c.getName()).collect(Collectors.toSet())); new JaxrsOpenApiContextBuilder() .openApiConfiguration(oasConfig) .buildContext(true); } catch (OpenApiConfigurationException e) { throw new RuntimeException(e.getMessage(), e); } } } }
@Override public void init(ServletConfig config) throws ServletException { super.init(config); String ctxId = getContextIdFromServletConfig(config); try { new ServletOpenApiContextBuilder() .servletConfig(config) .ctxId(ctxId) .buildContext(true); } catch (OpenApiConfigurationException e) { e.printStackTrace(); } }
.buildContext(true) .read(); String openapiJson = null;
.openApiConfiguration(openApiConfiguration) .ctxId(ctxId) .buildContext(true); OpenAPI oas = ctx.read(); boolean pretty = false;
.buildContext(true) .read(); String openapiJson = null;
@Override public void init(ServletConfig config) throws ServletException { super.init(config); String ctxId = getContextIdFromServletConfig(config); try { new ServletOpenApiContextBuilder() .servletConfig(config) .ctxId(ctxId) .buildContext(true); } catch (OpenApiConfigurationException e) { e.printStackTrace(); } }
.buildContext(true) .read(); String openapiJson = null;
.openApiConfiguration(openApiConfiguration) .ctxId(ctxId) .buildContext(true); OpenAPI oas = ctx.read(); boolean pretty = false;
.application(getApplication()) .openApiConfiguration(oasConfig) .buildContext(true); } catch (OpenApiConfigurationException e) { throw new InternalServerErrorException(e);
final OpenApiContext context = openApiConfiguration.buildContext(true); final Properties userProperties = getUserProperties( context
final OpenApiContext context = openApiConfiguration.buildContext(true); final Properties userProperties = getUserProperties( context