Currently XML Unions are not supporting in the RAML specification
Not fixed yet. Salesforce has scheduled a fix.
Summary
Using the following RAML API with XML union type for application/XML payloads.
#%RAML 1.0
title: myRaml
version: v1
types:
xmlTypeOne:
type: object
properties:
elementOne: string
elementTwo: integer
xmlTypeTwo:
type: object
properties:
elementA: boolean
elementB: string
/test:
post:
body:
application/xml:
type: xmlTypeOne | xmlTypeTwo
example: !include example.xml
and this XML payload:
<xmlTypeOne>
<elementOne>123</elementOne>
<elementTwo>wrong</elementTwo>
</xmlTypeOne>
When we try to make the call with XML payload, getting the below error.
ERROR 2024-10-16 16:49:31,402 [[MuleRuntime].uber.02: [test-xml-request].test-xml-requestFlow.CPU_LITE @1baafe97] [processor: test-xml-requestFlow/processors/0; event: 838c7520-8bb0-11ef-a1af-bcd074688d56] org.mule.runtime.core.privileged.exception.DefaultExceptionListener: ******************************************************************************** Message : cvc-elt.1.a: Cannot find the declaration of element 'xmlTypeOne'. Element : test-xml-requestFlow/processors/0 @ test-xml-request:test-xml-request.xml:15 (APIkit Router) Element DSL : <apikit:router doc:name="APIkit Router" doc:id="08095b79-31cf-4cce-bc00-69506d5490fa" config-ref="my-config"></apikit:router> Error type : APIKIT:BAD_REQUEST FlowStack : at test-xml-requestFlow(test-xml-requestFlow/processors/0 @ test-xml-request:test-xml-request.xml:15 (APIkit Router))
Workaround
We haven't loaded the full details for this issue yet. Check the official page.
History
First tracked here as Solution Scheduled
Nov 30, 2026
Also open in Design Center
Error: [Required Examples] Always include examples in parameters and headers
Solution ScheduledMuleSoft / Design CenterReported Aug 7, 20245 reports5reports
An API is returning error when trying to publish to Exchange
Solution ScheduledMuleSoft / Design CenterReported May 9, 20243 reports3reports
Unable to open and publish a big API Spec as Designer Center does not finish loading
In ReviewMuleSoft / Design CenterReported Oct 13, 20233 reports3reports
Design center is getting crashed while publishing an API specification to the Exchange
In ReviewMuleSoft / Design CenterReported Jul 30, 20252 reports2reports