3

We have one existing API, which we're trying to build a Blueprint for, that requires certain request bodies to be URI-encoded JSON.

Is there some way to specify a body as "like this, but encoded"?

Existing (mere text) documentation just shows the JSON, along with an airy reminder to encode it before sending:

POST /blah/blah/blah
Content-Type: application/x-www-form-urlencoded
Parameters: (x-www-form-urlencoded)

        { "title": "Buy cheese and bread for breakfast." }

But with Blueprint—and especially with Blueprint at apiary.io—you really have to show the actual body. Which is completely unreadable:

### Create a Note [POST]
+ Request (application/x-www-form-urlencoded)

        %7B%20%22title%22%3A%20%22Buy%20cheese%20and%20bread%20for%20breakfast.%22%20%7D

But specifying the readable text in the Blueprint fails (returns a parameter error):

### Create a Note [POST]
+ Request (application/x-www-form-urlencoded)

        { "title": "Buy cheese and bread for breakfast." }

The real sticking point is when I have Apiary talk to my real server: the readable request fails (because it's not encoded), while the unreadable one succeeds (because, as required, it is).

4

1 回答 1

0

我相信这尚不支持,但正在这里跟踪:https ://github.com/apiaryio/api-blueprint/issues/25

于 2013-12-24T19:40:08.853 回答