XSD "any" type equivalent in RAML


#1

Hi,
This is my first post here :slight_smile:

I am trying to see if there is an equivalent of XSD’s “any” (<xs:any maxOccurs=“unbounded” minOccurs=“0” processContents=“skip”/>) element type in RAML:

Sample XSD:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema elementFormDefault=“qualified” targetNamespace=“http://xmlns.oracle.com/Enterprise/Tools/schemas/xxxxxxx” xmlns:bip=“http://xmlns.oracle.com/Enterprise/Tools/schemas/xxxxx” xmlns:xs=“http://www.w3.org/2001/XMLSchema”>
<xs:element name=“query”>
xs:complexType
xs:sequence
<xs:element maxOccurs=“unbounded” minOccurs=“0” ref=“bip:row”/>
</xs:sequence>
<xs:attribute name=“numrows” type=“xs:integer” use=“required”/>
<xs:attribute name=“queryname” type=“xs:NCName” use=“required”/>
</xs:complexType>
</xs:element>
<xs:element name=“row”>
xs:complexType
xs:sequence
<xs:any maxOccurs=“unbounded” minOccurs=“0” processContents=“skip”/>
</xs:sequence>
<xs:attribute name=“rownumber” type=“xs:integer” use=“required”/>
</xs:complexType>
</xs:element>
</xs:schema>

Sample XML (based on the XSD above):
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
soapenv:Body


4352435245
XYZCC
XYZCCC
test@test.com123
xxx-xxx-xxxx


</soapenv:Body>
</soapenv:Envelope>

If there is no equivalent type, can you suggest how can i design the RAML api based on the XML? Thank you all in advance!

Cheers,
-Mukund.


#2

I think, I might have found an answer here: https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#the-any-type

basically, define the property to be:

row-type:
properties:
rownumber:
type: integer
//: # force all additional properties to be a any
type: any[]


#3

Yup. Seems like you answered your own question. Let us know if you need more help.