Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moznion committed Jan 12, 2014
1 parent 516f601 commit 473d591
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ Please also refer to example ([https://github.com/moznion/Test-JsonAPI-Autodoc/t
body => <% response body %>,
}

Moreover if `$note` is hash reference like below, you can describe each request parameters.

{
description => 'get message ok',
param_description => {
param1 => 'This is param1'
param2 => 'This is param2',
},
}

`description` is the same as the time of using as <$note> as scalar.
`param_description` contains descriptions about request parameters.
Now, this faculty only can describe request parameters are belonging to top level.
Please refer [https://github.com/moznion/Test-JsonAPI-Autodoc/tree/master/eg/http_with_req_params_description.t](https://github.com/moznion/Test-JsonAPI-Autodoc/tree/master/eg/http_with_req_params_description.t) and
[https://github.com/moznion/Test-JsonAPI-Autodoc/tree/master/eg/doc/http_with_req_params_description.md](https://github.com/moznion/Test-JsonAPI-Autodoc/tree/master/eg/doc/http_with_req_params_description.md).

- plack\_ok ($plack\_app, $request, $expected\_status\_code, $note)

`plack_ok` method carries out almost the same operation as `http_ok`.
Expand Down
16 changes: 16 additions & 0 deletions lib/Test/JsonAPI/Autodoc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,22 @@ Example of response structure;
body => <% response body %>,
}
Moreover if C<$note> is hash reference like below, you can describe each request parameters.
{
description => 'get message ok',
param_description => {
param1 => 'This is param1'
param2 => 'This is param2',
},
}
C<description> is the same as the time of using as <$note> as scalar.
C<param_description> contains descriptions about request parameters.
Now, this faculty only can describe request parameters are belonging to top level.
Please refer L<https://github.com/moznion/Test-JsonAPI-Autodoc/tree/master/eg/http_with_req_params_description.t> and
L<https://github.com/moznion/Test-JsonAPI-Autodoc/tree/master/eg/doc/http_with_req_params_description.md>.
=item * plack_ok ($plack_app, $request, $expected_status_code, $note)
C<plack_ok> method carries out almost the same operation as C<http_ok>.
Expand Down

0 comments on commit 473d591

Please sign in to comment.