Last active
February 4, 2020 14:25
-
-
Save davidcostadev/25f399176ca468ee20131a64ac8798ef to your computer and use it in GitHub Desktop.
Revisions
-
davidcostadev revised this gist
Nov 28, 2019 . 1 changed file with 0 additions and 56 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,6 @@ API spec of to handle with list of tasks 2. Create 3. Edit 4. Delete ### Endpoints @@ -17,7 +16,6 @@ API spec of to handle with list of tasks - GET `/tasks/{id}` - PUT `/tasks/{id}` - DELETE `/tasks/{id}` ### Default Response Status @@ -45,17 +43,6 @@ API spec of to handle with list of tasks ### GET /tasks #### Response **status**: 200 @@ -221,46 +208,3 @@ API spec of to handle with list of tasks **status**: 404 > no content needed -
davidcostadev revised this gist
Oct 13, 2019 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,28 +32,28 @@ API spec of to handle with list of tasks ## Task Entity | field | type | | ------------ | ------------------------ | | id | PK - `number` or `uuid` | | title | `varchar(255)`, NOT NULL | | description | `text` | | is_completed | `boolean` | | created_at | `datetime` ISO 8601 UTC | | modified_at | `datetime` ISO 8601 UTC | ## Endpoints descriptions ### GET /tasks #### Query Strings | field | type | default | description | | ------------ | ------ | ------- | ------------------------------------------------------------------ | | title | string | - | - | | description | string | - | - | | is_completed | string | - | true / false | | per_page | number | 25 | - | | page | number | 1 | - | | orderBy | string | | field.direction direction:(asc/desc). ex.: title.asc or title.desc | #### Response -
davidcostadev revised this gist
Oct 11, 2019 . 1 changed file with 24 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,8 @@ API spec of to handle with list of tasks | field | type | | ------------ | ----------------------- | | id | PK - `number` or `uuid` | | title | `varchar(255)` | | description | `text` | | is_completed | `boolean` | | created_at | `datetime` ISO 8601 UTC | | modified_at | `datetime` ISO 8601 UTC | @@ -48,11 +49,12 @@ API spec of to handle with list of tasks | field | type | default | description | | ------------ | ------ | ------- | ---------------------------------------------------------------- | | title | string | - | - | | description | string | - | - | | is_completed | string | - | true / false | | per_page | number | 25 | - | | page | number | 1 | - | | orderBy | string | | field.direction direction:(asc/desc). ex.: title.asc or title.desc | #### Response @@ -65,7 +67,8 @@ API spec of to handle with list of tasks "data": [ { "id": 1, "title": "Some title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" @@ -100,7 +103,8 @@ API spec of to handle with list of tasks ```json { "title": "Some title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true } ``` @@ -112,7 +116,8 @@ API spec of to handle with list of tasks ```json { "id": 1, "title": "Some title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" @@ -125,7 +130,7 @@ API spec of to handle with list of tasks ```json { "errors": [{ "key_error": "Invalid title parse" }] } ``` @@ -138,7 +143,8 @@ API spec of to handle with list of tasks ```json { "id": 1, "title": "Some title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" @@ -159,7 +165,7 @@ API spec of to handle with list of tasks ```json { "errors": [{ "key_error": "Invalid title parse" }] } ``` @@ -169,7 +175,8 @@ API spec of to handle with list of tasks ```json { "title": "Some title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true } ``` @@ -181,7 +188,8 @@ API spec of to handle with list of tasks ```json { "id": 1, "title": "Some title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" @@ -194,7 +202,7 @@ API spec of to handle with list of tasks ```json { "errors": [{ "key_error": "Invalid title parse" }] } ``` @@ -220,7 +228,7 @@ API spec of to handle with list of tasks ```json { "title": "Another title" } ``` @@ -239,7 +247,8 @@ or ```json { "id": 1, "title": "Another title", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" @@ -252,6 +261,6 @@ or ```json { "errors": [{ "key_error": "Invalid title parse" }] } ``` -
davidcostadev revised this gist
Oct 9, 2019 . 1 changed file with 37 additions and 45 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,38 +21,38 @@ API spec of to handle with list of tasks ### Default Response Status | code | description | | ---- | --------------------- | | 200 | OK | | 201 | Created | | 204 | Deleted | | 404 | Not found | | 422 | Unprocessable entity | | 500 | Internal server error | ## Task Entity | field | type | | ------------ | ----------------------- | | id | PK - `number` or `uuid` | | name | `varchar(255)` | | is_completed | `boolean` | | created_at | `datetime` ISO 8601 UTC | | modified_at | `datetime` ISO 8601 UTC | ## Endpoints descriptions ### GET /tasks #### Query Strings | field | type | default | description | | ------------ | ------ | ------- | ---------------------------------------------------------------- | | name | string | - | - | | is_completed | string | - | true / false | | per_page | number | 25 | - | | page | number | 1 | - | | orderBy | string | | field.direction direction:(asc/desc). ex.: name.asc or name.desc | #### Response @@ -123,27 +123,25 @@ orderBy | string | | field.direction direction:(asc/desc). ex.: n **status**: 422 ```json { "errors": [{ "key_error": "Invalid name parse" }] } ``` ### GET /tasks/{id} #### Response **status**: 200 ```json { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" } ``` @@ -159,11 +157,9 @@ status: 200 **status**: 422 ```json { "errors": [{ "key_error": "Invalid name parse" }] } ``` @@ -174,7 +170,7 @@ status: 200 ```json { "name": "Some Name", "is_completed": true } ``` @@ -188,19 +184,17 @@ status: 200 "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" } ``` #### Error Response **status**: 422 ```json { "errors": [{ "key_error": "Invalid name parse" }] } ``` @@ -226,15 +220,15 @@ status: 200 ```json { "name": "Some Name" } ``` or ```json { "is_completed": true } ``` @@ -248,18 +242,16 @@ or "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" } ``` #### Error Response **status**: 422 ```json { "errors": [{ "key_error": "Invalid name parse" }] } ``` -
davidcostadev revised this gist
Oct 9, 2019 . 1 changed file with 19 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,16 @@ code | description 422 | Unprocessable entity 500 | Internal server error ## Task Entity field | type -------------| ---- id | PK - `number` or `uuid` name | `varchar(255)` is_completed | `boolean` created_at | `datetime` ISO 8601 UTC modified_at | `datetime` ISO 8601 UTC ## Endpoints descriptions ### GET /tasks @@ -53,13 +63,13 @@ orderBy | string | | field.direction direction:(asc/desc). ex.: n ```json { "data": [ { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" } ], "meta": { "per_page": 50, @@ -91,7 +101,7 @@ orderBy | string | | field.direction direction:(asc/desc). ex.: n ```json { "name": "Some Name", "is_completed": true } ``` @@ -105,7 +115,7 @@ orderBy | string | | field.direction direction:(asc/desc). ex.: n "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00" } ``` -
davidcostadev revised this gist
Oct 9, 2019 . 1 changed file with 65 additions and 61 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,30 +1,34 @@ # TODO List Project API spec of to handle with list of tasks ### Features 1. List 2. Create 3. Edit 4. Delete 5. Patch ### Endpoints - GET `/tasks` - POST `/tasks` - GET `/tasks/{id}` - PUT `/tasks/{id}` - DELETE `/tasks/{id}` - PATCH `/tasks/{id}` ### Default Response Status code | description -----|------------ 200 | OK 201 | Created 204 | Deleted 404 | Not found 422 | Unprocessable entity 500 | Internal server error ## Endpoints descriptions @@ -35,14 +39,14 @@ field | type | default | description --------------|---------|---------|------------- name | string | - | - is_completed | string | - | true|false per_page | number | 25 | - page | number | 1 | - orderBy | string | | field.direction direction:(asc/desc). ex.: name.asc or name.desc #### Response **status**: 200 ##### 1. With Data @@ -52,16 +56,16 @@ status: 200 { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00", } ], "meta": { "per_page": 50, "page": 1, "total_items": 151, "total_pages": 4 } } ``` @@ -72,47 +76,47 @@ status: 200 { "data": [], "meta": { "per_page": 50, "page": 1, "total_items": 0, "total_pages": 0 } } ``` ### POST /tasks **body**: ```json { "name": "Some Name", "is_completed": true, } ``` #### Response **status**: 201 ```json { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00", } ``` #### Error Response **status**: 422 ```json { "errors": [ {"key_error": "Invalid name parse"} ] } ``` @@ -127,65 +131,65 @@ status: 200 { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00", } ``` #### Error Response ##### 1. Not found **status**: 404 > no content needed ##### 2. Unprocessable Entity **status**: 422 ```json { "errors": [ {"key_error": "Invalid name parse"} ] } ``` ### POST /tasks/{id} **body**: ```json { "name": "Some Name", "is_completed": true, } ``` #### Response **status**: 200 ```json { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00", } ``` #### Error Response **status**: 422 ```json { "errors": [ {"key_error": "Invalid name parse"} ] } ``` @@ -194,21 +198,21 @@ status: 422 #### Response **status**: 204 > no content needed #### Error Response ##### 1. Not found **status**: 404 > no content needed ### PATCH /tasks/{id} **body**: ```json { @@ -220,32 +224,32 @@ or ```json { "is_completed": true, } ``` #### Response **status**: 200 ```json { "id": 1, "name": "Some Name", "is_completed": true, "created_at": "2019-08-09T08:00:00", "modified_at": "2019-08-09T08:00:00", } ``` #### Error Response **status**: 422 ```json { "errors": [ {"key_error": "Invalid name parse"} ] } ``` -
davidcostadev revised this gist
Oct 8, 2019 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ status: 200 "id": 1, "name": "Some Name", "isCompleted": true, "createdAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ], @@ -100,7 +100,7 @@ status: 201 "id": 1, "name": "Some Name", "isCompleted": true, "createdAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` @@ -128,7 +128,7 @@ status: 200 "id": 1, "name": "Some Name", "isCompleted": true, "createdAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` @@ -173,7 +173,7 @@ status: 200 "id": 1, "name": "Some Name", "isCompleted": true, "createdAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` @@ -233,7 +233,7 @@ status: 200 "id": 1, "name": "Some Name", "isCompleted": true, "createdAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` -
davidcostadev created this gist
Oct 8, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,251 @@ # TODO List Project ### Features - List - Create - Edit - Delete - Patch ### Endpoints - GET /tasks - POST /tasks - GET/tasks/{id} - PUT /tasks/{id} - DELETE /tasks/{id} - PATCH /tasks/{id} ### Default Response Status - 200 OK - 201 Created - 204 Deleted - 404 Not found - 422 Unprocessable Entity - 500 Internal Server Error ## Endpoints descriptions ### GET /tasks #### Query Strings field | type | default | description --------------|---------|---------|------------- name | string | - | - isCompleted | string | - | true|false perPage | number | 25 | - page | number | 1 | - orderBy | string | | field.direction direction:(asc/desc). ex.: name.asc or name.desc #### Response status: 200 ##### 1. With Data ```json { "data": [ { "id": 1, "name": "Some Name", "isCompleted": true, "createAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ], "meta": { "perPage": 50, "page": 1, "totalItems": 151, "totalPages": 4 } } ``` ##### 2. With empty data ```json { "data": [], "meta": { "perPage": 50, "page": 1, "totalItems": 0, "totalPages": 0 } } ``` ### POST /tasks body: ```json { "name": "Some Name", "isCompleted": true, } ``` #### Response status: 201 ```json { "id": 1, "name": "Some Name", "isCompleted": true, "createAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` #### Error Response status: 422 ```json { "errors": [ {"keyError": "Invalid name parse"} ] } ``` ### GET /tasks/{id} #### Response status: 200 ```json { "id": 1, "name": "Some Name", "isCompleted": true, "createAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` #### Error Response ##### 1. Not found status: 404 > no content needed ##### 2. Unprocessable Entity status: 422 ```json { "errors": [ {"keyError": "Invalid name parse"} ] } ``` ### POST /tasks/{id} body: ```json { "name": "Some Name", "isCompleted": true, } ``` #### Response status: 200 ```json { "id": 1, "name": "Some Name", "isCompleted": true, "createAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` #### Error Response status: 422 ```json { "errors": [ {"keyError": "Invalid name parse"} ] } ``` ### DELETE /tasks/{id} #### Response status: 204 > no content needed #### Error Response ##### 1. Not found status: 404 > no content needed ### PATCH /tasks/{id} body: ```json { "name": "Some Name", } ``` or ```json { "isCompleted": true, } ``` #### Response status: 200 ```json { "id": 1, "name": "Some Name", "isCompleted": true, "createAt": "2019-08-09T08:00:00", "modifiedAt": "2019-08-09T08:00:00", } ``` #### Error Response status: 422 ```json { "errors": [ {"keyError": "Invalid name parse"} ] } ```