Azure Apim schema validation is case sensitive

Vikram Sudhini 25 Reputation points
2023-10-26T18:55:27.8633333+00:00

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?

<validate-content unspecified-content-type-action="detect" max-size="102400" size-exceeded-action="prevent" errors-variable-name="requestBodyValidation"> <content type="application/json" validate-as="json" action="prevent" allow-additional-properties="false" /> </validate-content>

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,122 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,321 Reputation points
    2023-10-26T20:28:40.0066667+00:00

    Vikram Sudhini Thanks for posting your question in Microsoft Q&A. The current implementation in Azure API Management does compare the property name in case sensitive way, and unfortunately, there is no config to change this behavior. Interestingly, I found Add support for comparing property names case-insensitively during validation PR merged with this ask in Newtonsoft.Json.Schema - .NET implementation.

    If you are interested in this feature in APIM, I suggest you submitting it via https://aka.ms/apimwish and others with similar interests can upvote it too. This will help our product team prioritize the features and I will also pass your feedback internally.

    I hope this helps and let me know if you have any questions.


    If you found the answer to your question helpful, please take a moment to mark it as Yes for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions. 


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.