Pajk/rails-restapi — pull request #17 by iNecas (2012-05-21 10:45:52+00:00)
Title: Recorded examples

It's now possible to save the examples to separate yml file so that is can be
regenerated automatically and then include it in the documentation. Usefull
with combination with integration tests.

The file is loaded from `doc/restapi_examples.yml` and it might look like this:

---
users#show:
- verb: :GET
path: /users/15
query:
request_data: # parsed data sent to server
response_data: # parsed data sent to client
code: 404
show_in_doc: 2 # if 0, don't include it in the documentation,
# it says also the order of examples in doc
recorded: true # to distinguish between automatically generated examples
# and manual ones
- verb: :GET # there can be more examples for an action
path: /users/14
query: "verbose=true"
request_data:
response_data:
id: 14
name: Test User
code: 200
show_in_doc: 1
recorded: true
users#create:
- verb: :POST
path: /users
query:
request_data:
user:
name: Test User
response_data:
id: 14
name: Test User
code: 200
show_in_doc: 1
recorded: true