I am currently using validate-content to validate the request body against api spec. when I set action="prevent" and allow-additional-properties="false", it is returns error when I pass property name with a different case in the request body. What can I do to ignore the case?
I tried to set action to detect and go through the error list detect but did not work
AFAIK,
validate-content
validates the definition of the schema including the case of properties and types.You can ignore the case of the property by using
action="detect"
which will not interrupt request or response processing but you will get the error message in Trace.I have used the below policy-
In my schema, property name is in small case but while testing I am passing below request body.
I am getting 200 OK result.
But you can see the detail execution of
validate-content
in trace.References- .net - Azure APIM Validate-Content Inbound policy, Validate Request Body - Stack Overflow.