Class OpenAPISpecFilterSet

  • All Implemented Interfaces:
    io.swagger.v3.core.filter.OpenAPISpecFilter

    public class OpenAPISpecFilterSet
    extends io.swagger.v3.core.filter.AbstractSpecFilter
    An implementation of the OpenAPISpecFilter that delegates the request to multiple registered filters. Since swagger-core always creates a new instance of this filter, the registered filters are stored statically.

    These filters is applied on every call to /openapi.{yaml|json} and can inject information from the request context.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void clear()
      Clear all filters
      java.util.Optional<io.swagger.v3.oas.models.OpenAPI> filterOpenAPI​(io.swagger.v3.oas.models.OpenAPI openAPI, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> params, java.util.Map<java.lang.String,​java.lang.String> cookies, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headers)  
      static void register​(io.swagger.v3.core.filter.OpenAPISpecFilter filter)
      Register a filter that should be called when an OpenAPI file is returned to a caller.
      • Methods inherited from class io.swagger.v3.core.filter.AbstractSpecFilter

        filterOperation, filterParameter, filterPathItem, filterRequestBody, filterResponse, filterSchema, filterSchemaProperty, isRemovingUnreferencedDefinitions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.swagger.v3.core.filter.OpenAPISpecFilter

        isOpenAPI31Filter
    • Constructor Detail

      • OpenAPISpecFilterSet

        public OpenAPISpecFilterSet()
    • Method Detail

      • register

        public static void register​(io.swagger.v3.core.filter.OpenAPISpecFilter filter)
        Register a filter that should be called when an OpenAPI file is returned to a caller.
        Parameters:
        filter - the filter to register
        See Also:
        clear()
      • clear

        public static void clear()
        Clear all filters
      • filterOpenAPI

        public java.util.Optional<io.swagger.v3.oas.models.OpenAPI> filterOpenAPI​(io.swagger.v3.oas.models.OpenAPI openAPI,
                                                                                  java.util.Map<java.lang.String,​java.util.List<java.lang.String>> params,
                                                                                  java.util.Map<java.lang.String,​java.lang.String> cookies,
                                                                                  java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headers)
        Specified by:
        filterOpenAPI in interface io.swagger.v3.core.filter.OpenAPISpecFilter
        Overrides:
        filterOpenAPI in class io.swagger.v3.core.filter.AbstractSpecFilter