An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hello @Johnson, Dana ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Thanks for sharing the test payload and the exact error message in Private message. Your XML payload is perfectly valid for the CAP v1.2 specification.
The specific error you are encountering - "Unspecified content type application/xml is not allowed." actually occurs before the XML content is validated against your schema. It means that the validate-content policy is blocking the request because your API operation's definition (the "Frontend" contract) has not been configured to expect application/xml as an incoming request format.
Because your policy is set to unspecified-content-type-action="prevent", API Management strictly checks the API definition to see if application/xml is declared.
According to the official Azure API Management validate-content documentation:
unspecified-content-type-action: Action to perform for requests or responses with a content type that isn't defined in the API schema.
To resolve this via the JSON Editor:
- In the Design tab for your
Create Alertoperation, click the pencil icon on the Frontend block. - In the JSON editor, locate your
postoperation (around the"operationId":line). - Insert a
requestBodydefinition right before the"responses"block to explicitly allowapplication/xmland link yourCAP1-2schema:"requestBody": { "content": { "application/xml": { "schema": { "$ref": "#/components/schemas/CAP1-2" } } } }, - Click Save at the bottom of the screen.
Once saved, the validate-content policy will recognize the payload content type and successfully validate it against your CAP schema.
Let me know if this resolves the issue.