1) When writing RAML, can I use nesting in my schema definition?
For example:
schemas:
- DNSResponse: |
{
\"type\": \"object\",
\
1) Yes, you can. See this example. That would be:
"items": { "$ref": "ARecord" }
2) I believe this is possible in Draft 4 of JSON Schema, using the oneOf directive. I don't think this is supported by RAML though. Alternatively, you could create a base schema and have ARecord, MXRecord and PTRRecord extend this base schema and then allow items of the base schema. This won't be very semantically rich but could get you started.