2017-01-30 64 views
0

我一直在努力工作數小時,試圖使其工作,並閱讀了所有文檔。在使用數據結構時將根添加到API藍圖

我需要e數組有一個根(根據json規範),而使用我已經定義的數據結構。我需要更改api藍圖?

JSON的必需

{ 「highlights」:  
    [ 
    { 
    「id」: 1, 
    「text」: 」some text」 
}, 
    { 
    「id」: 2, 
    「text」: 」some text」  
    },  
] 
} 

API藍圖

# Data Structures 

## Highlight1 (object) 

+ id : 1 

+ text: "never knew this" 

## Highlight2 (object) 

+ id : 1 

+ text: "never knew this」 

# Group 

## Feed [/highlights] 

### List [GET] 

+ Response 200 (application/json) 

<!-- this does not generate the root -->  
+ Attributes (array[Highlight1, Highlight2) 

回答

1

你需要做類似如下:

+ Response 200 (application/json) 
    + Attributes 
     + highlights (array) 
      + (Highlight1) 
      + (Highlight2) 
+0

謝謝!完成此操作:+屬性 +加亮(數組[突出顯示1,突出顯示2]) –