@Chris Parton Thanks for sharing more details. Yes, this is expected behavior as documented here.
When you mark query string parameters as required in your swagger definition, APIM will import the parameter as URL template parameter which is by design.
If template parameter is not provided, the URL which defines the API itself is not complete thus APIM cannot match the API's then returning 404. This has been designed behavior of API Management from the beginning.
You can either:
- Manually change via form-based editor in Azure Portal, or
- Remove the "required" attribute from the Open API definition, thus not converting them to template parameters.
Unfortunately, as of now there are no plans to change this behavior in the near term. While we understand this is not ideal behavior for your scenario, but as this is used by other customers which may be depending on this behavior (returning 404 instead of 400).
You can submit a feature request here so the product team can implement the feature which can control this behavior. The default behavior can be 404 but customers can override to 400 as per their requirement. I have also passed this feedback to our team but will suggest you to post the same as feature request in our feedback forum.