Array with multiple types RAML 0.8



I’m trying to model an array that could have multiple types.

So I have two schema declared schemaA and schemaB and would like to model a response that could have both these objects.

Can I do something like:

"objectives": {
        "type": "array",
        "items": {
            "$ref": "schemaA | schemaB"


In JSON I think you might want to look at That’s the only resource I know off.

In RAML 1.0 you can use RAML Data Types to do that:

    type: array
    items: schemaA | schemaB


Once you go black, you’ll never go back. Seriously, 1.0 is sooo much better than 0.8.


Agreed. I am just starting on that path now, and 1.0 is such a huge and beautiful improvement over 0.8! It will truly allow you to design complex APIs using modular pieces and all in YAML!


thanks all for the reply. I guess I’m stuck at RAML 0.8 coz the plugin is yet to catch up with RAML 1.0.