Using any of multiple schemas to validate the input body

Please provide a solution to the error I’m getting. My aim is to validate an incoming body with 3 schemas. I declared union of the three user-defined types as the type of body in my endpoint (please check raml), but it threw error - Trying to replace a bastard child node. union type cannot be of an external type

Error -
org.mule.module.apikit.exception.ApikitRuntimeException: Invalid API descriptor – errors found: 1
Raml parser uncaught exception: Trying to replace a bastard child node TypeDeclarationNode on parent application/json: ErrorNode [Invalid facets for type A: union type cannot be of an external type].

My files are -

RAML -


A_request - image
A_schema -
B_request - image
B_schema -

FYI - We have just encountered the same issue.

BTW Your style of RAML very similar to the way I do it.

1 Like

I got this working by using RAML datatypes rather than json schema.

I’m going to report that error message to Mulesoft. Very un-pc

1 Like