问题标签 [apiary.io]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
rest - 如何将资源创建和其他方法放在同一个组中?
假设我创建了一个资源,POST /resource
并在响应正文上产生一个id
,然后我用它id
来检索我的资源GET /resource/{id}
。
如何将这两个请求放在同一个 API 蓝图组中?
显然,一个组只有一个端点,这使得以下看起来您将创建一个POST /resource/{id}
不正确的资源,因为此时您甚至没有 id。
我查看了示例,但找不到创建和检索特定资源的示例。我这样做是错误的吗?
apiblueprint - 如何使用 API 蓝图添加值描述?
有没有办法为 URI 参数的可能值添加描述?
如果我使用上面给出的方法,那么我不能定义example
和default
值(例如,4
),因为它需要完整的值(4 - date
)。
apiblueprint - Different request on same action with parameters
I want to search (say) "accounts
" based on "name" or "status".
So I would like to have two actions :
GET /persons/?q=name==Jea*
GET /persons/?q=status==locked
How can I document that ?
I tried an Action with multiples transactions :
But Apiary editor complains because :
I must provide a message-body for my GET requests:
Message-body asset is expected to be a pre-formatted code block, every of its line indented by exactly 8 spaces or 2 tabs.
The
+ Parameters
block is not recognized :Ignoring unrecognized block
Thanks a lot
apiblueprint - 为单个 HTTP 方法指定查询参数
为了说明我的问题,我从 Apiary.io 蓝图教程中制作了一个精简示例。
然后在我的养蜂场文档中,我得到以下信息:
since
但是,对我来说,仅将查询参数用于 GET 请求是有意义的。不幸的是,我没有找到实现此结果的方法:
有可能吗?
apiblueprint - Apiary.io API Blueprint: Action Parameter enforcement for mock service
In my blueprint, I have an action parameter for the GET action that is defined as a required parameter. However when I invoke the mock service endpoint without the parameter I get a legal response. Is there any runtime enforcement corresponding to the defined action parameter constraints?
javascript - node.js - grunt - 从回调返回解析的数据
我想使用 API 蓝图并通过 grunt 自动实现。我想读取 apiary(API 蓝图工具)文件,解析它(使用 Protagonist,它是 Node.js 的 API 蓝图解析器),将其字符串化为 JSON 格式并写入另一个文件。这是一项简单的任务,但我不知道该怎么做,我总是得到未定义的结果。这是我到目前为止所拥有的:
结果 apiary.js 是这样的:
apiary.io - .NET piaryProvider VS 常规的 .NET System.Net.WebRequest
刚开始作为客户/消费者与 ApiAry 合作,我想知道最好的方法是什么。
我应该使用常规的 .NET System.Net.WebRequest 还是 ApiaryProvider ( http://fsprojects.github.io/ApiaryProvider/ ),为什么?
如果有人可以帮助提供示例 C# 代码,那将会很有帮助。
ios - Apiary io 混合来自 iOS 的 json
我正在尝试将一个简单的 json 对象从 iOS 发送到养蜂场服务器。我在创建它后打印出我的 json 对象,一切看起来都很好。但是养蜂场把一切都搞混了。如果我只有一个项目,那么它看起来不错。
在这里我创建对象并对其进行编码
接下来我使用 AFNetworking 发送数据
记录我得到的解码的 json 对象
最后,在养蜂场我得到以下信息
json都混在一起了。我不确定 AFNetworking 是罪魁祸首还是 apiary 混合了它,我不应该担心它,因为真正的服务器不会有这个问题。
最后,这是我设置养蜂场的方式
有人看到我在做什么可疑的事情吗?谢谢
哦,除了混淆之外,json还有重复的数据。
apiblueprint - api蓝图中给定端点的多个响应
是否可以在 API 蓝图中为给定端点定义一组可能的响应?
例如,如果我有一个端点,例如 /movie/{id} 我希望能够定义一组电影记录,以便在模拟服务器中我可以 GET /movie/1 或 GET /movie/2 或 GET /movie/3 并获取相关记录。
我见过的所有例子似乎都只定义了一种可能的反应。