public OpenAPI filter()

in geronimo-openapi-impl/src/main/java/org/apache/geronimo/microprofile/openapi/impl/filter/FilterImpl.java [44:72]


    public OpenAPI filter(final OpenAPI api) {
        ofNullable(api.getComponents()).ifPresent(this::filterComponents);
        ofNullable(api.getPaths())
                .ifPresent(paths -> paths.forEach((k, v) -> {
                    ofNullable(v.readOperationsMap())
                            .ifPresent(operations -> {
                                operations.entrySet().stream()
                                        .filter(it -> it.getValue() != null)
                                        .filter(it -> delegate.filterOperation(it.getValue()) == null)
                                        .map(Map.Entry::getKey)
                                        .collect(toList())
                                        .forEach(operations::remove);
                                operations.values().stream().filter(Objects::nonNull).forEach(this::filterOperation);
                            });

                    paths.entrySet().stream()
                            .filter(it -> delegate.filterPathItem(it.getValue()) == null)
                            .map(Map.Entry::getKey)
                            .collect(toList())
                            .forEach(paths::remove);

                    ofNullable(v.getParameters()).ifPresent(this::filterParameters);
                    ofNullable(v.getServers()).ifPresent(this::filterServers);
                }));
        ofNullable(api.getServers()).ifPresent(this::filterServers);
        ofNullable(api.getTags()).ifPresent(this::filterTags);
        delegate.filterOpenAPI(api);
        return api;
    }