KonstantinSviridov / wadl-for-raml

0 stars 0 forks source link

Schemas missing in generated RAML #3

Open avinashpaul opened 9 years ago

avinashpaul commented 9 years ago

Hi @KonstantinSviridov , I try out this project. It does a great job of converting WADL to RAML , It is missing a common feature , the below WADL request element

<request>
<representation xmlns:cns="http://www.example.org" mediaType="application/xml" element="cns:Customer" />
</request>

is mapped in raml as below

body: 
      application/xml: 
        schema: Customer

But the Schemas section does not have any reference to Customer , the below part is missing from generated RAML file

schemas:
  - Customer:      !include path-to-schemas/file.xsd or "the xsd itself"
KonstantinSviridov commented 9 years ago

Hi, @avinashpaul. Sorry for late response. We had a lot to do for the "Connect" conference.

Right now we do not support such manner of including chemes. We support only standard. According to it, the element attribute must contain "qualified name of the root element as described within the grammars section".

So, could you, please tell more about the syntax you use. Is it a common practice?

Regards, Konstantin

avinashpaul commented 9 years ago

@KonstantinSviridov thank you for the reply , so you mean to say only the below case is handled

 <grammars>
      <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <element name="Customer">
            <complexType>
               <sequence>
                  <element name="id" type="string" />
               </sequence>
            </complexType>
         </element>
 </grammars>
    ....
    ....
    ....
<representation  mediaType="application/xml" element="Customer" />
KonstantinSviridov commented 9 years ago

I would say, it would work like this:

<grammars> 
    <include href="http://www.example.com/Schema_where_Customer_element_is_defined.xsd"/>
</grammars>
<representation  mediaType="application/xml" element="Customer" />

The resulting schema will be just the same as Schema_where_Customer_element_is_defined.xsd.