Class ApiOperationResolver
java.lang.Object
com.atlassian.oai.validator.interaction.ApiOperationResolver
Component responsible for matching an incoming request path + method with an operation defined in the OAI spec.
-
Constructor Summary
ConstructorsConstructorDescriptionApiOperationResolver(io.swagger.v3.oas.models.OpenAPI api, String basePathOverride, boolean strictPathMatching) A utility for finding the best fitting API path. -
Method Summary
Modifier and TypeMethodDescriptionfindApiOperation(String path, Request.Method method) Tries to find the best fitting API path matching the given path and request method.
-
Constructor Details
-
ApiOperationResolver
public ApiOperationResolver(io.swagger.v3.oas.models.OpenAPI api, @Nullable String basePathOverride, boolean strictPathMatching) A utility for finding the best fitting API path.- Parameters:
api- the OpenAPI definitionbasePathOverride- (Optional) override for the base path defined in the OpenAPI specification.strictPathMatching- Enable strict path matching. If enabled, a trailing slash indicates a different path than without.
-
-
Method Details
-
findApiOperation
Tries to find the best fitting API path matching the given path and request method.- Parameters:
path- the requests path to find in API definitionmethod- theRequest.Methodfor the request- Returns:
- a
ApiOperationMatchcontaining the information if the path is defined, the operation is allowed and having the necessaryApiOperationif applicable
-