2017-08-14 17 views
0
responses: 
    200: 
    body: 
     application/xml: 
     example: | 
      <?xml version="1.0" encoding="UTF-8"?> 
      <my_response> 
      <result>success</result> 
      <message>great</message> 
      </my_response> 

RAMLエンドポイント定義の有効なインラインアプリケーション/ xml本文の例ですか?どのようにしなければならないのでしょうか?RAMLインラインアプリケーション/ xml例

答えて

2

はいです。 目的に応じて、XSDを使用してタイプを指定することもできます。たとえば :

/jobs: 
    displayName: Jobs 
    post: 
    description: Create a Job 
    body: 
     text/xml: 
     type: | 
      <xs:schema attributeFormDefault="unqualified" 
        elementFormDefault="qualified" 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
      <xs:element name="api-request"> 
       <xs:complexType> 
       <xs:sequence> 
        <xs:element type="xs:string" name="input"/> 
       </xs:sequence> 
       </xs:complexType> 
      </xs:element> 
      </xs:schema> 

はまた、XMLシリアル化のために使用されるいくつかの特別なキーワードがあります。https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#xml-serialization-of-type-instances