2015-07-20 43 views
0

因此,我使用Apiary來保存和數據數組,然後調用數據以在HTML上顯示,但我只希望Apiary將有限的數據量發送到HTML,而不是完整的數組。仍然試圖讓我的腦袋周圍的Apiary語法,所以只是想知道如果我正在朝着正確的方向(或者我會通過前端做這件事?),因爲我使用的不起作用,牛逼明確對我說:蜂房限制回覆返回

##news updates [/articles{?limit}] 
###Get all news [GET] 

+ Parameters 

+ limit (number, optional) 
    + Default: '3' 



+ Request 

    + Header 

     Authorization: Basic dXNlcjpwYXNzd29yZA== 
     x-api-verson: 1.0 



+ Response 200 (application/json) 


     { 
       "articles": [ 
        { 
         *array item one* 
        }, 
        { 
         *array item two* 
        }, 
        { 
         *array item three* 
        }, 
        { 
         *array item four* 
        }, 
        ] 
     } 

回答

0

您可以設置多個實例,每個在這裏:

https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md#example-multiple-transaction-examples

然後你就可以使用身高頭球每個「調用非一個模擬的請求訪問不同的例子 - 默認回覆「部分:

http://support.apiary.io/knowledgebase/articles/117119-handling-multiple-actions-on-a-single-resource

+0

謝謝,我已經閱讀過這些文檔,但它們並不是特別清楚,因爲如何將有限的數據從數組發送到HTML – Whirlwind990

+0

Apiary在響應內沒有數組的概念。 *您必須自己準備過濾陣列作爲不同的響應。 – vzsg