Skip to content

Commit

Permalink
Issue #117 adding docs for projects GET method
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Dec 4, 2016
1 parent 4d27911 commit efcd439
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
10 changes: 6 additions & 4 deletions app/Http/Controllers/ProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ public function __construct(ProjectsRepository $projectsRepository)
/**
* Show all projects.
*
* @return array @Get("/")
* @Versions({"v1"})
* @Request({})
* @Response(200, body={"id": 1, "name": "project name", "url": "http://<host>:<port>/<path>", "description": "project description"})
* @Get("/{?page}")
* @Versions({"v1"})
* @Request("")
* @Response(200, body={"total":2,"per_page":15,"current_page":1,"last_page":1,"next_page_url":null,"prev_page_url":null,"from":1,"to":15,"data": {{"id":1,"project_statuses_id":"1","name":"Project A","description":"# Project A\n\nThis is the **project A**","created_by":"1","created_at":"2016-11-12 12:00:56","updated_at":"2016-11-12 12:00:56"},{"id":2,"project_statuses_id":"1","name":"Project B","description":"# Project B\n\nThis is the **project B**","created_by":"1","created_at":"2016-11-12 12:00:56","updated_at":"2016-11-12 12:00:56"}}})
*
* return array
*/
public function index()
{
Expand Down
36 changes: 30 additions & 6 deletions docs/documentation/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,46 @@ FORMAT: 1A
# Projects [/projects]
Project resource representation.

## Show all projects. [GET /projects]
## Show all projects. [GET /projects{?page}]


+ Request (application/json)
+ Body

[]
""

+ Response 200 (application/json)
+ Body

{
"id": 1,
"name": "project name",
"url": "http://<host>:<port>/<path>",
"description": "project description"
"total": 2,
"per_page": 15,
"current_page": 1,
"last_page": 1,
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 15,
"data": [
{
"id": 1,
"project_statuses_id": "1",
"name": "Project A",
"description": "# Project A\n\nThis is the **project A**",
"created_by": "1",
"created_at": "2016-11-12 12:00:56",
"updated_at": "2016-11-12 12:00:56"
},
{
"id": 2,
"project_statuses_id": "1",
"name": "Project B",
"description": "# Project B\n\nThis is the **project B**",
"created_by": "1",
"created_at": "2016-11-12 12:00:56",
"updated_at": "2016-11-12 12:00:56"
}
]
}

# Test Plans [/testplans]
Expand Down

0 comments on commit efcd439

Please sign in to comment.