apiary

Represent File Uploads in API Blueprints

喜你入骨 提交于 2020-01-04 03:53:13
问题 We have an API end point where an image file can be uploaded along with the name of the file (a string) as well as a description (string). Apiary / API Blueprints won't allow me to have something like: + Request (multipart/form-data) + Headers Authorization: [key] + Attributes + name (string, required) - A human-readable name of the Catalog Item + description (string, optional) - A human readable description of the Catalog Item + image (file, optional) - An image file corresponding to the

Apiary: Export API as JSON, to generate client code

拜拜、爱过 提交于 2020-01-03 09:12:22
问题 We all know that apiary rocks (or not.. I think it does), and I was wondering what would it take to take it a step further allow users to export a JSON description of the API? (So developers can script client code generation) This should help: http://ttezel.github.io/blog/2013/02/23/stop-writing-rest-api-clients/ 回答1: There are two directions you can explore: you can use Alpaca to generate client SDKs. Alpaca accepts API Blueprint as one of it's input formats for more flexibility, you can use

MSON to describe object attributes in blueprint

女生的网名这么多〃 提交于 2019-12-23 02:31:20
问题 I have an issue similar to what is described here. I have a JSON that looks like this: { "photos": [ { "key": "y37dmj10jkwof/moOIUB8912JKVgh", "caption": "A world of gamers.", "tags": [ "game", "japan" ], "attributes": { "copyright": true, "use": [ "public", "private" ] } } ] } and I am trying to describe the attributes using MSON, to render the blueprint. However, I am not successful at it. Here is my attempt: + Attributes (required, object) + photos (required, array) + (object) + key

Apiary: Is it possible to document what JSON response fields are?

我的梦境 提交于 2019-12-21 04:21:27
问题 I would like to document what the actual JSON fields themselves represent. I have documented the GET statement, and parameters but this does not make a complete documentation to give to users. So, in the example below how would I add a comment about "OtherFields". Is this supported? Or do I need to make a companion document somewhere else. ## View Applications [/cat{?sort}{&order}{&page}] ### List all Applications ### Get List of Applications [GET] + Parameters + sort (optional, string) ...

How to add API version to Apiary Mock Server

与世无争的帅哥 提交于 2019-12-12 21:29:42
问题 Is there any way to add API version to Apiary Mock Server? Ex.: http://private-XXXXX-apiname.apiary-mock.com/ v1 /mocks/1?school_id=1 回答1: Yes, when declaring HOST , you can append suffix to it and that is then propagated as prefix to all resources: FORMAT: 1A HOST: http://api.example.tld/v1/ 来源: https://stackoverflow.com/questions/30245487/how-to-add-api-version-to-apiary-mock-server

Repeating a MSON data structure with different values

☆樱花仙子☆ 提交于 2019-12-10 11:44:06
问题 I have many places in my API where I will need to describe a list of objects. Each object has the same keys / structure but different values. How can I tweak the values of each instance of some data structure while retaining all the original type, description, etc of the original structure? for example if I had the following data structure Restaurant # Data Structures ## Restaurant (object) + restaurant_name: McDonald's (string, required) - The name of this restaurant + years_of_operation: 54

Does Apiary.io and/or API Blueprint support api versioning?

被刻印的时光 ゝ 提交于 2019-12-07 06:51:45
问题 Does api blueprint or Apiary.io support the notion of versioning your API? In particular, I'm versioning my API via the URI like this: GET /api/v2/SomeResource/ In the example above, this means I'm calling version 2 ("v2") of the API. Does api blueprint support this? How can I document multiple versions of a given action or the entire API? 回答1: You can use HOST header to signify that: HOST: http://example.com/api/v2 is going to prefix all resources with /api/v2 . In the API Blueprint, if you

Create Mock Service API using Apiary

只谈情不闲聊 提交于 2019-12-06 10:34:45
问题 I'm attempting to create mock api services for testing purposes. We are already using Apiary on another team so I'm starting there. So far, I've noticed that if I want to have two separate calls requires mocking out of both requests. For example to get the notes with ids 1 and 2 requires explicitly writing out responses like: /notes/1 /notes/2 Is there a way to avoid this? Admittedly I'm still ramping up on creating blueprints. 回答1: Have a look at private-e9e59-pingdomcheck.apiary-mock.com/v1

Does Apiary.io and/or API Blueprint support api versioning?

泄露秘密 提交于 2019-12-05 10:07:31
Does api blueprint or Apiary.io support the notion of versioning your API? In particular, I'm versioning my API via the URI like this: GET /api/v2/SomeResource/ In the example above, this means I'm calling version 2 ("v2") of the API. Does api blueprint support this? How can I document multiple versions of a given action or the entire API? You can use HOST header to signify that: HOST: http://example.com/api/v2 is going to prefix all resources with /api/v2 . In the API Blueprint, if you use URL prefixing, the APIs are considered different and therefore you should use different blueprints for

Create Mock Service API using Apiary

不问归期 提交于 2019-12-04 16:26:16
I'm attempting to create mock api services for testing purposes. We are already using Apiary on another team so I'm starting there. So far, I've noticed that if I want to have two separate calls requires mocking out of both requests. For example to get the notes with ids 1 and 2 requires explicitly writing out responses like: /notes/1 /notes/2 Is there a way to avoid this? Admittedly I'm still ramping up on creating blueprints. Have a look at private-e9e59-pingdomcheck.apiary-mock.com/v1/gists/1 . The number 1 is {id} here. You of course get only the general defined response (like if I used id