Class ApiOperationResolver

java.lang.Object
com.atlassian.oai.validator.interaction.ApiOperationResolver

public class ApiOperationResolver extends Object
Component responsible for matching an incoming request path + method with an operation defined in the OAI spec.
  • 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 definition
      basePathOverride - (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

      @Nonnull public ApiOperationMatch findApiOperation(String path, Request.Method method)
      Tries to find the best fitting API path matching the given path and request method.
      Parameters:
      path - the requests path to find in API definition
      method - the Request.Method for the request
      Returns:
      a ApiOperationMatch containing the information if the path is defined, the operation is allowed and having the necessary ApiOperation if applicable