I have an APIM instance with an OpenAPI spec imported. One of the endpoints has a mandatory query parameter, with application-level validation.
When I call the endpoint without the mandatory query parameter, APIM doesn't match the URL, and returns a 404 response:
{
"statusCode": 404,
"message": "Resource not found"
}
However, I want the request to be validated by the application, so I can return a meaningful 400 response to the client. Is this possible without making the parameter optional in my OpenAPI spec?
I've tried adding a validate-content policy statement as per https://docs.microsoft.com/en-us/azure/api-management/validation-policies#actions, bit I still get a 404 error.
Others have hit the same issue:

