Package org.openapitools.codegen
Class OpenAPINormalizer.Filter
- java.lang.Object
-
- org.openapitools.codegen.OpenAPINormalizer.Filter
-
- Enclosing class:
- OpenAPINormalizer
protected static class OpenAPINormalizer.Filter extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETHODprotected Set<String>methodFiltersstatic StringOPERATION_IDprotected Set<String>operationIdFiltersstatic StringPATHprotected Set<String>pathStartingWithFiltersstatic StringTAGprotected Set<String>tagFilters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(String path, io.swagger.v3.oas.models.PathItem pathItem, Map<String,Function<io.swagger.v3.oas.models.PathItem,io.swagger.v3.oas.models.Operation>> methodMap)protected org.slf4j.LoggergetLogger()protected booleanhasCustomFilterMatch(String path, io.swagger.v3.oas.models.Operation operation)Test if the OpenAPI contract match an extra filter.booleanhasFilter()protected booleanlogIfMatch(String filterName, io.swagger.v3.oas.models.Operation operation, boolean filterMatched)protected voidlogMatch(String filterName, io.swagger.v3.oas.models.Operation operation)booleanparse()Perform the parsing of the filter string.protected voidparse(String filterName, String filterValue)Parse non default filters.protected voidparseFails(String filterName, String filterValue)protected Set<String>splitByPipe(String filterValue)Split the filterValue by pipe.
-
-
-
Field Detail
-
OPERATION_ID
public static final String OPERATION_ID
- See Also:
- Constant Field Values
-
METHOD
public static final String METHOD
- See Also:
- Constant Field Values
-
TAG
public static final String TAG
- See Also:
- Constant Field Values
-
PATH
public static final String PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Filter
protected Filter(String filters)
-
-
Method Detail
-
parse
public boolean parse()
Perform the parsing of the filter string.- Returns:
- true if filters need to be processed
-
splitByPipe
protected Set<String> splitByPipe(String filterValue)
Split the filterValue by pipe.- Returns:
- the split values.
-
parse
protected void parse(String filterName, String filterValue)
Parse non default filters. Override this method to add custom parsing logic. By default throws IllegalArgumentException.- Parameters:
filterName- name of the filterfilterValue- value of the filter
-
hasCustomFilterMatch
protected boolean hasCustomFilterMatch(String path, io.swagger.v3.oas.models.Operation operation)
Test if the OpenAPI contract match an extra filter. Override this method to add custom logic.- Parameters:
operation- Openapi Operationpath- Path of the operation- Returns:
- true if the operation of path match the filter
-
hasFilter
public boolean hasFilter()
-
apply
public void apply(String path, io.swagger.v3.oas.models.PathItem pathItem, Map<String,Function<io.swagger.v3.oas.models.PathItem,io.swagger.v3.oas.models.Operation>> methodMap)
-
logIfMatch
protected boolean logIfMatch(String filterName, io.swagger.v3.oas.models.Operation operation, boolean filterMatched)
-
logMatch
protected void logMatch(String filterName, io.swagger.v3.oas.models.Operation operation)
-
getLogger
protected org.slf4j.Logger getLogger()
-
-