apiblueprint

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

Specify description for every response we have in Apiary.io

谁都会走 提交于 2019-12-07 03:01:31
问题 Is it possible to specify description for every response to some request? Suppose, we have a request ### Retrieve resource [GET] + Headers If-None-Match: "Version1" And 2 responses + Response 200 (application/xml) + Headers ETag: "Version2" + Body <Xml> <A> <B /> <C /> </A> </Xml> + Response 304 (application/xml) What I would like is to specify description like here (please note comments right under + Response lines): + Response 200 (application/xml) In case if the resource hasn't changed +

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

Documenting query parameters with API Blueprint

自古美人都是妖i 提交于 2019-12-04 16:19:00
问题 I'm trying to document a query parameter in API Blueprint, but I'm not entirely sure if I have done it correctly. The resource looks like this: DELETE http://baasar.apiary-mock.com/user/{appId}/{userId} That request would deactivate the user while the following would delete the user object: DELETE http://baasar.apiary-mock.com/user/{appId}/{userId}?force=true This is the Blueprint markdown I have for this: ## User [/user/{appId}/{userId}] Handle user objects + Parameters + appId (required,

How to specify an optional element for a json request object

不羁岁月 提交于 2019-12-04 04:21:58
In API blueprint I am looking to specify an optional json element for a POST message. Example for; ### Add a new User [POST] To add a User send a JSON ..... + Request (application/json) { "name": "A name", "age": 30 } How do I indicate to reader of API that age is optional in API call but still show that it's an integer? ~Colin Currently there is no dedicated support for doing this. However there are few ways how to achieve this. My preferable is to discuss it in the request description using a markdown formatting of your liking e.g: ### Add a new User [POST] To add a User send a JSON ..... +

Documenting query parameters with API Blueprint

左心房为你撑大大i 提交于 2019-12-03 10:17:06
I'm trying to document a query parameter in API Blueprint, but I'm not entirely sure if I have done it correctly. The resource looks like this: DELETE http://baasar.apiary-mock.com/user/{appId}/{userId} That request would deactivate the user while the following would delete the user object: DELETE http://baasar.apiary-mock.com/user/{appId}/{userId}?force=true This is the Blueprint markdown I have for this: ## User [/user/{appId}/{userId}] Handle user objects + Parameters + appId (required, number, `1`) ... Application ID (`appId`) + userId (required, number, `1`) ... Numeric `userId` of the

How do I document a multipart request with apiary?

廉价感情. 提交于 2019-12-03 05:40:42
问题 I want to document a multipart request like the following: Content-Length: 477 Content-Type: multipart/form-data; boundary=---BOUNDARY -----BOUNDARY Content-Disposition: form-data; name="image[file]"; filename="image.jpg" Content-Type: image/jpeg Content-Transfer-Encoding: base64 /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL

Apiary.io - multiple responses (200) with different parameters

拜拜、爱过 提交于 2019-11-30 18:11:19
I am trying to get different responses passing different parameters but something is not working. This is my API: ## Question [/questions/{question_id}] A Question object has the following attributes: + Parameters + question_id: `1` (number, required) - ID of the Question in form of an integer ### View a Questions Detail [GET] + Request + Header X-Custom-Header : 1 + Response 200 (application/json) { "id": "1", "name": "Marco" } + Request + Header X-Custom-Header : 2 + Response 200 (application/json) { "id: "2", "name": "Lucas" } But when calling /questions/1 or /questions/2 the response is