private void filterOperation()

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


    private void filterOperation(final Operation op) {
        ofNullable(op.getServers()).ifPresent(this::filterServers);
        ofNullable(op.getRequestBody()).ifPresent(it -> {
            if (delegate.filterRequestBody(it) == null) {
                op.requestBody(null);
            }
        });
        ofNullable(op.getParameters()).ifPresent(this::filterParameters);
        ofNullable(op.getCallbacks()).ifPresent(this::filterCallbacks);
        ofNullable(op.getResponses())
                .ifPresent(responses -> {
                    responses.forEach((rk, response) -> {
                        ofNullable(response.getLinks()).ifPresent(this::filterLinks);
                        ofNullable(response.getContent())
                                .ifPresent(contents -> contents.values().forEach(content -> {
                                    ofNullable(content.getSchema()).ifPresent(schema -> {
                                        if (delegate.filterSchema(schema) == null) {
                                            content.setSchema(null);
                                        }
                                    });
                                }));
                    responses.entrySet().stream()
                            .filter(it -> delegate.filterAPIResponse(it.getValue()) == null)
                            .map(Map.Entry::getKey)
                            .collect(toList())
                            .forEach(responses::remove);
                    });
                });
    }