Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
szytko committed Dec 9, 2014
1 parent 2116340 commit 704bbf3
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ class TestController extends ControllerAbstract
* {type: 'Error 404', description: 'Test was not found'},
* {type: 'Error 500', description: 'Application error'}
* ],
* requestFormat='JSON',
* requestContentType='application/json',
* request={
* {name: 'id', type: 'MongoId', description: 'ID of something'}
* },
* requestExample='{
* "id": "123"
* }',
* responseFormat='JSON',
* responseContentType='application/json',
* response=[
Expand Down Expand Up @@ -144,26 +152,30 @@ class TestController extends ControllerAbstract
* errors=[
* {type: 'Error 500', description: 'Unknown error'}
* ],
* requestFormat='JSON',
* requestContentType='application/json',
* request=''
* requestExample='',
* responseFormat='JSON',
* responseContentType='application/json',
* response=[
* [
* {
* {name: 'id', type: 'MongoId', description: 'Test ID'},
* {name: 'name', type: 'string', description: 'Test name'}
* ],
* [
* },
* {
* {name: 'id', type: 'MongoId', description: 'Test ID'},
* {name: 'name', type: 'string', description: 'Test name'}
* ]
* }
* ],
* responseExample='[
* {
* "id": "123",
* "name": "Test"
* "name": "Test 1"
* },
* {
* "id": "124",
* "name": "Test"
* "name": "Test 2"
* }
* ]'
* )
Expand Down Expand Up @@ -218,13 +230,21 @@ class TestController extends ControllerAbstract

`errors` Describes errors

`request` Describes request

`requestContentType` Determines request Content-Type

`requestFormat` Determines request format

`requestExample` Example of request body

`response` Describes response

`responseContentType` Determines response Content-Type

`responseFormat` Determines response format

`responseExample` Example of a method response
`responseExample` Example of response body


#### Create documentation layout ( you can use sample layout from tests/fixtures/app/layouts/partials/apiDoc directory ) and prepare output directory
Expand All @@ -243,4 +263,4 @@ mkdir public/apiDoc
php cli/cli.php app:apidoc generate
```

Check example documentation [http://jsbin.com/tufajuciqo/1?output](http://jsbin.com/tufajuciqo/1?output)
Check example documentation [http://jsbin.com/sigebogegu/1](http://jsbin.com/sigebogegu/1)

0 comments on commit 704bbf3

Please sign in to comment.