2016-05-11 33 views
1

私は2つの主なリソースを持つAPIを持っています:ProjectProduct、それらは2つの異なるリソースであり、それらの間には1つのリンクしかありません。RAML 1.0内部型の配列

Product: 
    type: object 
    properties: 
    name: string 
    projects: ProjectReference[] 

ProjectReference: 
    type: object 
    properties: 
    identifier: string 
    links: Links[] 

Project: 
    type: object 
    properties: 
    identifier: string 
    members: string[] 
    product: 
     type: object 
     properties: 
     name: string 
     links: Link[] 

Link: 
    type: object 
    properties: 
    rel: string 
    href: string 

私はProductProjectReferenceタイプをインライン化したいと思います。しかし、私はインライン型の配列を作成する方法を見出していません。

RAML 1.0でインライン型の配列を作成できますか?

答えて

1

ないインライン化の利点が何であるかを確認してください....しかし、あなたはこれを行うことができます:

Product: 
    type: object 
    properties: 
    name: string 
    projects: 
     type: array 
     items: 
     type: object 
     properties: 
      identifier: string 
      links: Links[] 
+0

利点は私が単独で使用されることはありません1とし、というのが私のタイプを汚染する必要がないということです私は衝突を避けるために名前を発明するために手を振っていません。ありがとう –

関連する問題