2015-07-20 68 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