Java Code Examples for org.eclipse.microprofile.openapi.OASFilter#filterRequestBody()

The following examples show how to use org.eclipse.microprofile.openapi.OASFilter#filterRequestBody() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilterUtil.java    From smallrye-open-api with Apache License 2.0 5 votes vote down vote up
/**
 * Filters the given model.
 * 
 * @param filter
 * @param model
 */
private static void filterOperation(OASFilter filter, Operation model) {
    if (model != null) {
        filterCallbacks(filter, model.getCallbacks());
        model.setParameters(filterParameterList(filter, model.getParameters()));
        filterRequestBody(filter, model.getRequestBody());
        if (model.getRequestBody() != null && filter.filterRequestBody(model.getRequestBody()) == null) {
            model.setRequestBody(null);
        }
        if (model.getResponses() != null) {
            filterAPIResponses(filter, model.getResponses().getAPIResponses());
        }
        filterServers(filter, model.getServers());
    }
}
 
Example 2
Source File: FilterUtil.java    From smallrye-open-api with Apache License 2.0 5 votes vote down vote up
/**
 * Filters the given models.
 * 
 * @param filter
 * @param models
 */
private static void filterRequestBodies(OASFilter filter, Map<String, RequestBody> models) {
    if (models != null) {
        Collection<String> keys = new ArrayList<>(models.keySet());
        for (String key : keys) {
            RequestBody model = models.get(key);
            filterRequestBody(filter, model);

            if (filter.filterRequestBody(model) == null) {
                models.remove(key);
            }
        }
    }
}