-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
762a4b7
commit 3f11e2b
Showing
2 changed files
with
379 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?php | ||
|
||
namespace App\Documents; | ||
|
||
/** | ||
* | ||
* @OA\Schema(schema="TasksResource", type="object", example={ "messages": { { "type": "success", "text": "responser::response.info" } }, "data": {{ "id": 3, "user": { "id": 1, "name": null, "email": "[email protected]", "created_at": "2024-02-22 22:00:13" }, "title": "Indoor sports", "description": null, "completed_at": null, "created_at": "2024-02-22 22:05:07" }}, "meta": {} }) | ||
* @OA\Schema(schema="TaskResource", type="object", example={ "messages": { { "type": "success", "text": "responser::response.info" } }, "data": { "id": 3, "user": { "id": 1, "name": null, "email": "[email protected]", "created_at": "2024-02-22 22:00:13" }, "title": "Indoor sports", "description": null, "completed_at": null, "created_at": "2024-02-22 22:05:07" }, "meta": {} }) | ||
* | ||
* @OA\Post( | ||
* path="/api/tasks", | ||
* tags={"Task"}, | ||
* summary="Task Create API", | ||
* security={{"bearerAuth":{}}}, | ||
* @OA\RequestBody(required=true, | ||
* @OA\MediaType( | ||
* mediaType="application/json", | ||
* @OA\Schema(required={}, | ||
* example={"title": "Indoor sports"} | ||
* ) | ||
* ) | ||
* ), | ||
* @OA\Response(response=200, description="Success", | ||
* @OA\MediaType(mediaType="application/json", | ||
* @OA\Schema(type="object",ref="#/components/schemas/TaskResource") | ||
* ) | ||
* ), | ||
* ) | ||
* | ||
* @OA\Patch ( | ||
* path="/api/tasks/{id}", | ||
* tags={"Task"}, | ||
* summary="Task Update API", | ||
* security={{"bearerAuth":{}}}, | ||
* @OA\Parameter(name="id",in="path",description="id",@OA\Schema(type="integer")), | ||
* @OA\RequestBody(required=true, | ||
* @OA\MediaType( | ||
* mediaType="application/json", | ||
* @OA\Schema(required={}, | ||
* example={"title": "Indoor sports","description": "4*10 Stretching movement"} | ||
* ) | ||
* ) | ||
* ), | ||
* @OA\Response(response=200, description="Success", | ||
* @OA\MediaType(mediaType="application/json", | ||
* @OA\Schema(type="object",ref="#/components/schemas/TaskResource") | ||
* ) | ||
* ), | ||
* ) | ||
* | ||
* | ||
* @OA\Get ( | ||
* path="/api/tasks/{id}", | ||
* tags={"Task"}, | ||
* summary="Task Show API", | ||
* security={{"bearerAuth":{}}}, | ||
* @OA\Parameter(name="id",in="path",description="id",@OA\Schema(type="integer")), | ||
* @OA\Response(response=200, description="Success", | ||
* @OA\MediaType(mediaType="application/json", | ||
* @OA\Schema(type="object",ref="#/components/schemas/TaskResource") | ||
* ) | ||
* ), | ||
* ) | ||
* | ||
* @OA\Delete ( | ||
* path="/api/tasks/{id}", | ||
* tags={"Task"}, | ||
* summary="Task Show API", | ||
* security={{"bearerAuth":{}}}, | ||
* @OA\Parameter(name="id",in="path",description="id",@OA\Schema(type="integer")), | ||
* @OA\Response(response=200, description="Success", | ||
* @OA\MediaType(mediaType="application/json", | ||
* @OA\Schema(type="object",ref="#/components/schemas/TaskResource") | ||
* ) | ||
* ), | ||
* ) | ||
* | ||
* | ||
* @OA\Post( | ||
* path="/api/tasks/{id}/complete", | ||
* tags={"Task"}, | ||
* summary="Complete Task API", | ||
* security={{"bearerAuth":{}}}, | ||
* @OA\Parameter(name="id",in="path",description="id",@OA\Schema(type="integer")), | ||
* @OA\Response(response=200, description="Success", | ||
* @OA\MediaType(mediaType="application/json", | ||
* @OA\Schema(type="object",ref="#/components/schemas/TaskResource") | ||
* ) | ||
* ), | ||
* ) | ||
* | ||
* | ||
* @OA\Get( | ||
* path="/api/tasks", | ||
* tags={"Task"}, | ||
* summary="list Task API", | ||
* security={{"bearerAuth":{}}}, | ||
* @OA\Response(response=200, description="Success", | ||
* @OA\MediaType(mediaType="application/json", | ||
* @OA\Schema(type="object",ref="#/components/schemas/TasksResource") | ||
* ) | ||
* ), | ||
* ) | ||
* | ||
*/ | ||
|
||
class Task | ||
{ | ||
|
||
} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,6 +305,223 @@ | |
} | ||
] | ||
} | ||
}, | ||
"/api/tasks": { | ||
"get": { | ||
"tags": [ | ||
"Task" | ||
], | ||
"summary": "list Task API", | ||
"operationId": "1d403e6635b90851c520cd710eb619c8", | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TasksResource" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
}, | ||
"post": { | ||
"tags": [ | ||
"Task" | ||
], | ||
"summary": "Task Create API", | ||
"operationId": "2d72d39cb4de213bb8d219a472abfb70", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"required": [], | ||
"example": { | ||
"title": "Indoor sports" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TaskResource" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
} | ||
}, | ||
"/api/tasks/{id}": { | ||
"get": { | ||
"tags": [ | ||
"Task" | ||
], | ||
"summary": "Task Show API", | ||
"operationId": "9d2ea5f1c7ed2641039ec9ce7fac1fac", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "id", | ||
"schema": { | ||
"type": "integer" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TaskResource" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
}, | ||
"delete": { | ||
"tags": [ | ||
"Task" | ||
], | ||
"summary": "Task Show API", | ||
"operationId": "3203f2e74812d3ed714ff99351646a70", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "id", | ||
"schema": { | ||
"type": "integer" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TaskResource" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
}, | ||
"patch": { | ||
"tags": [ | ||
"Task" | ||
], | ||
"summary": "Task Update API", | ||
"operationId": "261489a50c3380bcf2d0916ff401372c", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "id", | ||
"schema": { | ||
"type": "integer" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"required": [], | ||
"example": { | ||
"title": "Indoor sports", | ||
"description": "4*10 Stretching movement" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TaskResource" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
} | ||
}, | ||
"/api/tasks/{id}/complete": { | ||
"post": { | ||
"tags": [ | ||
"Task" | ||
], | ||
"summary": "Complete Task API", | ||
"operationId": "aea6d999ec5a03afd7e56ab5bc7b50b7", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "id", | ||
"schema": { | ||
"type": "integer" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TaskResource" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"components": { | ||
|
@@ -387,6 +604,58 @@ | |
}, | ||
"meta": [] | ||
} | ||
}, | ||
"TasksResource": { | ||
"type": "object", | ||
"example": { | ||
"messages": [ | ||
{ | ||
"type": "success", | ||
"text": "responser::response.info" | ||
} | ||
], | ||
"data": [ | ||
{ | ||
"id": 3, | ||
"user": { | ||
"id": 1, | ||
"name": null, | ||
"email": "[email protected]", | ||
"created_at": "2024-02-22 22:00:13" | ||
}, | ||
"title": "Indoor sports", | ||
"description": null, | ||
"completed_at": null, | ||
"created_at": "2024-02-22 22:05:07" | ||
} | ||
], | ||
"meta": [] | ||
} | ||
}, | ||
"TaskResource": { | ||
"type": "object", | ||
"example": { | ||
"messages": [ | ||
{ | ||
"type": "success", | ||
"text": "responser::response.info" | ||
} | ||
], | ||
"data": { | ||
"id": 3, | ||
"user": { | ||
"id": 1, | ||
"name": null, | ||
"email": "[email protected]", | ||
"created_at": "2024-02-22 22:00:13" | ||
}, | ||
"title": "Indoor sports", | ||
"description": null, | ||
"completed_at": null, | ||
"created_at": "2024-02-22 22:05:07" | ||
}, | ||
"meta": [] | ||
} | ||
} | ||
}, | ||
"securitySchemes": { | ||
|