Skip to content
Bug Barometer

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

  1. First tracked here as Solution Scheduled

    Nov 30, 2026

Also open in Design Center