@Override public OpenAPI read(Set<Class<?>> classes, Map<String, Object> resources) { OpenAPI openApi = openApiConfiguration.getOpenAPI(); return openApi; } };
@Override public void setConfiguration(OpenAPIConfiguration openApiConfiguration) { if (openApiConfiguration != null) { this.config = ContextUtils.deepCopy(openApiConfiguration); if (openApiConfiguration.getOpenAPI() != null) { this.openAPI = this.config.getOpenAPI(); if (this.openAPI.getComponents() != null) { this.components = this.openAPI.getComponents(); } } } }
merged.setOpenAPI(parentConfig.getOpenAPI());
@Override public OpenAPI read(Set<Class<?>> classes, Map<String, Object> resources) { OpenAPI openApi = openApiConfiguration.getOpenAPI(); return openApi; } };
@Override public void setConfiguration(OpenAPIConfiguration openApiConfiguration) { if (openApiConfiguration != null) { this.config = ContextUtils.deepCopy(openApiConfiguration); if (openApiConfiguration.getOpenAPI() != null) { this.openAPI = this.config.getOpenAPI(); if (this.openAPI.getComponents() != null) { this.components = this.openAPI.getComponents(); } } } }
@Override public void setConfiguration(OpenAPIConfiguration openApiConfiguration) { if (openApiConfiguration != null) { this.config = deepCopy(openApiConfiguration); if (openApiConfiguration.getOpenAPI() != null) { this.openAPI = this.config.getOpenAPI(); if (this.openAPI.getComponents() != null) { this.components = this.openAPI.getComponents(); } } } }
public OpenAPIConfiguration customize(final OpenAPIConfiguration configuration) { if (configuration == null) { return configuration; } if (dynamicBasePath) { final MessageContext ctx = createMessageContext(); // If the JAX-RS application with custom path is defined, it might be present twice, in the // request URI as well as in each resource operation URI. To properly represent server URL, // the application path should be removed from it. final String url = StringUtils.removeEnd( StringUtils.substringBeforeLast(ctx.getUriInfo().getRequestUri().toString(), "/"), applicationPath); final Collection<Server> servers = configuration.getOpenAPI().getServers(); if (servers == null || servers.stream().noneMatch(s -> s.getUrl().equalsIgnoreCase(url))) { configuration.getOpenAPI().setServers(Collections.singletonList(new Server().url(url))); } } return configuration; }
public OpenAPIConfiguration customize(final OpenAPIConfiguration configuration) { if (configuration == null) { return configuration; } if (dynamicBasePath) { final MessageContext ctx = createMessageContext(); // If the JAX-RS application with custom path is defined, it might be present twice, in the // request URI as well as in each resource operation URI. To properly represent server URL, // the application path should be removed from it. final String url = StringUtils.removeEnd( StringUtils.substringBeforeLast(ctx.getUriInfo().getRequestUri().toString(), "/"), applicationPath); final Collection<Server> servers = configuration.getOpenAPI().getServers(); if (servers == null || servers.stream().noneMatch(s -> s.getUrl().equalsIgnoreCase(url))) { configuration.getOpenAPI().setServers(Collections.singletonList(new Server().url(url))); } } return configuration; }
@Override public OpenAPIConfiguration customize(final OpenAPIConfiguration configuration) { super.customize(configuration); MessageContext ctx = JAXRSUtils.createContextValue( JAXRSUtils.getCurrentMessage(), null, MessageContext.class); String url = StringUtils.substringBeforeLast(ctx.getUriInfo().getRequestUri().getRawPath(), "/"); configuration.getOpenAPI().setServers(Collections.singletonList(new Server().url(url))); return configuration; }
customizer.customize(oas); if (!Objects.equals(configuration.getOpenAPI().getInfo(), oas.getInfo())) { configuration.getOpenAPI().setInfo(oas.getInfo()); if (!Objects.equals(configuration.getOpenAPI().getComponents(), oas.getComponents())) { configuration.getOpenAPI().setComponents(oas.getComponents()); if (!Objects.equals(configuration.getOpenAPI().getExternalDocs(), oas.getExternalDocs())) { configuration.getOpenAPI().setExternalDocs(oas.getExternalDocs()); if (!Objects.equals(configuration.getOpenAPI().getPaths(), oas.getPaths())) { configuration.getOpenAPI().setPaths(oas.getPaths()); if (!Objects.equals(configuration.getOpenAPI().getTags(), oas.getTags())) { configuration.getOpenAPI().setTags(oas.getTags()); if (!Objects.equals(configuration.getOpenAPI().getExtensions(), oas.getExtensions())) { configuration.getOpenAPI().setExtensions(oas.getExtensions());
customizer.customize(oas); if (!Objects.equals(configuration.getOpenAPI().getInfo(), oas.getInfo())) { configuration.getOpenAPI().setInfo(oas.getInfo()); if (!Objects.equals(configuration.getOpenAPI().getComponents(), oas.getComponents())) { configuration.getOpenAPI().setComponents(oas.getComponents()); if (!Objects.equals(configuration.getOpenAPI().getExternalDocs(), oas.getExternalDocs())) { configuration.getOpenAPI().setExternalDocs(oas.getExternalDocs()); if (!Objects.equals(configuration.getOpenAPI().getPaths(), oas.getPaths())) { configuration.getOpenAPI().setPaths(oas.getPaths()); if (!Objects.equals(configuration.getOpenAPI().getTags(), oas.getTags())) { configuration.getOpenAPI().setTags(oas.getTags()); if (!Objects.equals(configuration.getOpenAPI().getExtensions(), oas.getExtensions())) { configuration.getOpenAPI().setExtensions(oas.getExtensions());
merged.setOpenAPI(parentConfig.getOpenAPI());