Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ swagger hotfix #51

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/Annotations/OpenApi/AnnotationsInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
* title="ITA Profiles page API documentation",
* description="Documentation needed for the API Rest for the ITA Profiles page to IT Academy. Some useful links below:
* [ITA Profles Backend](https://github.com/IT-Academy-BCN/ita-profiles-backend)
* [ITA Profiles Frontend](https://github.com/IT-Academy-BCN/ita-profiles-frontend)
* To use the endpoints, prefix them with '**api/v1**'. For example: '**POST: https://itaperfils.eurecatacademy.org/api/v1/students'**'."
* [ITA Profiles Frontend](https://github.com/IT-Academy-BCN/ita-profiles-frontend)"
* )
*
* @OA\Server(
* url="http://127.0.0.1:8000"
* )
* @OA\Server(
* url="http://127.0.0.1:8000/api/v1"
* )
*/
class AnnotationsInfo {}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AnnotationsTag
* @OA\Property(property="status", type="boolean", example=false),
* @OA\Property(property="message", type="string", example="Unauthorized")
* )
* )
* ),
* @OA\Response(
* response=404,
* description="No tags found.",
Expand All @@ -61,19 +61,18 @@ public function index() {}
* tags={"Tags"},
* summary="Create a new tag",
* description="Creates a new tag. Admin Authentication is required.",
*
* security={{"bearer": {}}},
* required=true,
*
* @OA\JsonContent(
*
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
* type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="tag_name", type="string", example="Laravel"),
* @OA\Property(property="created_at", type="string", format="date-time", example="2024-01-25T12:34:56Z"),
* @OA\Property(property="updated_at", type="string", format="date-time", example="2024-01-25T12:34:56Z"),
* )
* )
* ),
*
* @OA\Response(
* response=201,
* description="Tag created successfully.",
Expand Down Expand Up @@ -104,6 +103,7 @@ public function store() {}
* description="Retrieve details of a specific tag based on the provided ID. Admin Authentication is required.",
*
* security={{"bearer": {}}},
* @OA\Parameter(
* name="id",
* in="path",
* required=true,
Expand All @@ -116,10 +116,9 @@ public function store() {}
* description="Tag details retrieved successfully.",
*
* @OA\JsonContent(
* type="array",
*
* @OA\Items(
* type="object",
* type="object",
*
* @OA\Property(
* property="data",
* type="object",
Expand All @@ -138,7 +137,7 @@ public function store() {}
* @OA\Property(property="message", type="string", example="Tag not found."),
* ),
* ),
* )
* )
*/
public function show() {}

Expand All @@ -149,8 +148,9 @@ public function show() {}
* tags={"Tags"},
* summary="Update details of a specific tag.",
* description="Updates details of a specific tag based on the provided ID. Admin Authentication is required.",
*
* security={{"bearer": {}}},
* @OA\Parameter(

* name="id",
* in="path",
* required=true,
Expand Down Expand Up @@ -203,8 +203,8 @@ public function update() {}
* tags={"Tags"},
* summary="Delete a specific tag.",
* description="Deletes a specific tag based on the provided ID. Admin Authentication is required.",
*
* security={{"bearer": {}}},
* @OA\Parameter(
* name="id",
* in="path",
* required=true,
Expand Down
103 changes: 74 additions & 29 deletions storage/api-docs/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"openapi": "3.0.0",
"info": {
"title": "ITA Profiles page API documentation",
"description": "Documentation needed for the API Rest for the ITA Profiles page to IT Academy. Some useful links below:\n * [ITA Profles Backend](https://github.com/IT-Academy-BCN/ita-profiles-backend)\n * [ITA Profiles Frontend](https://github.com/IT-Academy-BCN/ita-profiles-frontend)\n * To use the endpoints, prefix them with '**api/v1**'. For example: '**POST: https://itaperfils.eurecatacademy.org/api/v1/students'**'.",
"description": "Documentation needed for the API Rest for the ITA Profiles page to IT Academy. Some useful links below:\n * [ITA Profles Backend](https://github.com/IT-Academy-BCN/ita-profiles-backend)\n * [ITA Profiles Frontend](https://github.com/IT-Academy-BCN/ita-profiles-frontend)",
"version": "1.0.0"
},
"servers": [
{
"url": "http://127.0.0.1:8000"
},
{
"url": "http://127.0.0.1:8000/api/v1"
}
],
"paths": {
Expand Down Expand Up @@ -1442,6 +1445,26 @@
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"properties": {
"status": {
"type": "boolean",
"example": false
},
"message": {
"type": "string",
"example": "Unauthorized"
}
},
"type": "object"
}
}
}
},
"404": {
"description": "No tags found.",
"content": {
Expand Down Expand Up @@ -1530,7 +1553,12 @@
}
}
}
}
},
"security": [
{
"bearer": []
}
]
}
},
"/tags/{id}": {
Expand Down Expand Up @@ -1559,30 +1587,32 @@
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"properties": {
"id": {
"type": "integer",
"example": 1
},
"tag_name": {
"type": "string",
"example": "Laravel"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2024-01-25T12:34:56Z"
"properties": {
"data": {
"properties": {
"id": {
"type": "integer",
"example": 1
},
"tag_name": {
"type": "string",
"example": "Laravel"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2024-01-25T12:34:56Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2024-01-25T12:34:56Z"
}
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2024-01-25T12:34:56Z"
}
},
"type": "object"
}
"type": "object"
}
},
"type": "object"
}
}
}
Expand All @@ -1603,7 +1633,12 @@
}
}
}
}
},
"security": [
{
"bearer": []
}
]
},
"put": {
"tags": [
Expand Down Expand Up @@ -1694,7 +1729,12 @@
}
}
}
}
},
"security": [
{
"bearer": []
}
]
},
"delete": {
"tags": [
Expand Down Expand Up @@ -1748,7 +1788,12 @@
}
}
}
}
},
"security": [
{
"bearer": []
}
]
}
}
},
Expand Down Expand Up @@ -1967,4 +2012,4 @@
}
}
}
}
}