From c825a410edc111d77536d37469d5eff9f3c5e4e8 Mon Sep 17 00:00:00 2001 From: Lapotor <17144397+Lapotor@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:13:40 +0100 Subject: [PATCH] chore: update OpenAPI version in `swagger.yml` (#88) Update OpenAPI version in `swagger.yml` from v2.0 to v3.0. Ensure compatibility with OpenAPI v3.0 specifications and improve overall API documentation. Signed-off-by: Valentin Sickert <17144397+Lapotor@users.noreply.github.com> --- .github/assets/swagger,yml | 1449 +++++++++++++++++++++++------------- 1 file changed, 935 insertions(+), 514 deletions(-) diff --git a/.github/assets/swagger,yml b/.github/assets/swagger,yml index 247f447c..dd204899 100644 --- a/.github/assets/swagger,yml +++ b/.github/assets/swagger,yml @@ -1,762 +1,1183 @@ -swagger: "2.0" +openapi: 3.0.1 info: title: RadioSchedule API description: API for the broadcast schedule - version: 1.0.0 license: name: AGPL-3.0 url: https://github.com/Lapotor/RadioRoster-api/blob/main/LICENSE -schemes: - - https -consumes: - - application/json -produces: - - application/json + version: 1.0.0 +servers: + - url: http://localhost/api/v1 paths: /shows: get: tags: - Shows - summary: "Returns the broadcast schedule for a specified time period." + summary: Returns the broadcast schedule for a specified time period. operationId: getSchedule - produces: - - application/json parameters: - - in: query - name: start_date - description: "Start date of the broadcast schedule." - type: string - format: date-time - - in: query - name: end_date - description: "End date of the broadcast schedule." - type: string - format: date-time - - in: query - name: days - description: "Number of days for which to return the broadcast schedule." - type: integer - maximum: 30 + - name: start_date + in: query + description: Start date of the broadcast schedule. + schema: + type: string + format: date-time + - name: end_date + in: query + description: End date of the broadcast schedule. + schema: + type: string + format: date-time + - name: days + in: query + description: Number of days for which to return the broadcast schedule. + schema: + maximum: 30 + type: integer responses: "200": - description: "OK" - schema: - type: array - items: - $ref: "#/definitions/Show" + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Show" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: tags: - Shows - summary: "Creates a new show." + summary: Creates a new show. operationId: createShow - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json - parameters: - - in: body - name: show - description: "The details of the new show to create." - schema: - $ref: "#/definitions/Show" + requestBody: + description: The details of the new show to create. + content: + application/json: + schema: + $ref: "#/components/schemas/Show" + required: false responses: "201": - description: "CREATED" - schema: - $ref: "#/definitions/Show" + description: CREATED + content: + application/json: + schema: + $ref: "#/components/schemas/Show" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /shows/{id}: get: tags: - Shows - summary: "Retrieves a show by ID." + summary: Retrieves a show by ID. operationId: getShow - produces: - - application/json parameters: - - in: path - name: id - description: "The ID of the show to retrieve." - type: integer + - name: id + in: path + description: The ID of the show to retrieve. required: true + schema: + type: integer responses: "200": - description: "OK" - schema: - $ref: "#/definitions/Show" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Show" "400": - $ref: "#/responses/400" + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: tags: - Shows - summary: "Updates an existing show by ID." + summary: Updates an existing show by ID. operationId: updateShow - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json parameters: - name: id in: path - description: "The ID of the show to update." - type: integer + description: The ID of the show to update. required: true - - name: show - in: body - description: "The updated details of the show." schema: - $ref: "#/definitions/Show" + type: integer + requestBody: + description: The updated details of the show. + content: + application/json: + schema: + $ref: "#/components/schemas/Show" + required: false responses: "200": - description: "OK" - schema: - $ref: "#/definitions/Show" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Show" "400": - $ref: "#/responses/400" + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + delete: tags: - Shows - summary: "Deletes a show by ID." + summary: Deletes a show by ID. operationId: deleteShow - security: - - BearerAuth: [] parameters: - - in: path - name: id - description: "The ID of the show to delete." - type: integer + - name: id + in: path + description: The ID of the show to delete. required: true + schema: + type: integer responses: "204": - description: "NO CONTENT" + description: NO CONTENT + content: {} "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /requests: get: tags: - Requests - summary: "Retrieves the wishbox requests." + summary: Retrieves the wishbox requests. operationId: getRequests - security: - - BearerAuth: [] - produces: - - application/json responses: "200": - description: "OK" - schema: - type: array - items: - $ref: "#/definitions/Request" + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Request" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + put: tags: - Requests - summary: "Sends a request to the radio station's wishbox." + summary: Sends a request to the radio station's wishbox. operationId: sendRequest - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json - parameters: - - in: body - name: request - description: "Information about the wish request." - schema: - $ref: "#/definitions/Request" + requestBody: + description: Information about the wish request. + content: + application/json: + schema: + $ref: "#/components/schemas/Request" + required: false responses: "201": - description: "CREATED" - schema: - $ref: "#/definitions/Request" + description: CREATED + content: + application/json: + schema: + $ref: "#/components/schemas/Request" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /requests/{id}: delete: tags: - Requests - summary: "Deletes a specific wishlist request by ID." + summary: Deletes a specific wishlist request by ID. operationId: deleteRequest - security: - - BearerAuth: [] parameters: - name: id in: path - description: "The ID of the wishbox request to delete." - type: integer + description: The ID of the wishbox request to delete. required: true + schema: + type: integer responses: "204": - description: "NO CONTENT" + description: NO CONTENT + content: {} "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /users: get: tags: - User - summary: "Returns a list of all registered users." + summary: Returns a list of all registered users. operationId: getUsers - security: - - BearerAuth: [] - produces: - - application/json responses: "200": - description: "OK" - schema: - type: array - items: - $ref: "#/definitions/User" + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + post: tags: - User - summary: "Creates a new user." + summary: Creates a new user. operationId: createUser - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json - parameters: - - in: body - name: user - description: "User object that needs to be added." - schema: - $ref: "#/definitions/User" + requestBody: + description: User object that needs to be added. + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: false responses: "200": - description: "OK" - schema: - $ref: "#/definitions/User" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/User" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /users/{id}: get: tags: - User - summary: "Gets a user by ID." + summary: Gets a user by ID. operationId: getUser - security: - - BearerAuth: [] - produces: - - application/json parameters: - - in: path - name: id - type: integer - description: "The ID of the user to retrieve." + - name: id + in: path + description: The ID of the user to retrieve. required: true + schema: + type: integer responses: "200": - description: "OK" - schema: - $ref: "#/definitions/User" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/User" "400": - $ref: "#/responses/400" + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + put: tags: - User - summary: "Updates a user by ID." + summary: Updates a user by ID. operationId: updateUser - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json parameters: - name: id in: path - description: "The ID of the user to update." - type: integer - required: true - - name: user - in: body - description: "The updated user information." + description: The ID of the user to update. required: true schema: - $ref: "#/definitions/User" + type: integer + requestBody: + description: The updated user information. + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true responses: "200": - description: "OK" - schema: - $ref: "#/definitions/User" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/User" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + delete: tags: - User - summary: "Deletes a user by ID." + summary: Deletes a user by ID. operationId: deleteUser - security: - - BearerAuth: [] parameters: - name: id in: path - description: "The ID of the user to delete." - type: integer + description: The ID of the user to delete. required: true + schema: + type: integer responses: "204": - description: "NO CONTENT" + description: NO CONTENT + content: {} "400": - $ref: "#/responses/400" + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /roles: get: tags: - Role - summary: "Retrieves all availble roles" + summary: Retrieves all availble roles operationId: getAllRoles - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json responses: "200": - description: "OK" - schema: - type: array - items: - $ref: "#/definitions/Role" + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Role" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + post: tags: - Role - summary: "Add a role" + summary: Add a role operationId: createRole - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json - parameters: - - in: body - name: Role data - description: "The data for the role which should be added" - schema: - $ref: "#/definitions/Role" + requestBody: + description: The data for the role which should be added + content: + application/json: + schema: + $ref: "#/components/schemas/Role" + required: false responses: "200": - description: "OK" - schema: - $ref: "#/definitions/Role" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Role" "400": - $ref: "#/responses/400" + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /roles/{id}: get: tags: - Role - summary: "Retrieves a roles" + summary: Retrieves a roles operationId: getRole - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json parameters: - - in: path - name: id + - name: id + in: path required: true - type: integer + schema: + type: integer responses: "200": - description: "OK" - schema: - $ref: "#/definitions/Role" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Role" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + put: tags: - Role - summary: "Update a role" + summary: Update a role operationId: updateRole - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json parameters: - - in: path - name: id - required: true - type: integer - - in: body - name: changes + - name: id + in: path required: true schema: - $ref: "#/definitions/Role" + type: integer + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Role" + required: true responses: "200": - description: "OK" - schema: - $ref: "#/definitions/Role" + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Role" "400": - $ref: "#/responses/400" + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] + delete: tags: - Role - summary: "Deletes a role" + summary: Deletes a role operationId: deleteRole - security: - - BearerAuth: [] - consumes: - - application/json - produces: - - application/json parameters: - - in: path - name: id + - name: id + in: path required: true - type: integer + schema: + type: integer responses: "204": - description: "NO CONTENT" + description: NO CONTENT + content: {} "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "403": - $ref: "#/responses/403" + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "404": - $ref: "#/responses/404" + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] /login: post: tags: - Auth - summary: "Logs in a user and returns a JWT-Token." + summary: Logs in a user and returns a JWT-Token. operationId: login - consumes: - - application/json - produces: - - application/json - parameters: - - in: body - name: credentials - description: "The user's login information." - schema: - type: object - properties: - username: - type: string - password: - type: string - required: - - username - - password + requestBody: + description: The user's login information. + content: + application/json: + schema: + required: + - password + - username + type: object + properties: + username: + type: string + password: + type: string + required: false responses: "200": - description: "OK" - schema: - type: object - properties: - access_token: - type: string + description: OK + content: + application/json: + schema: + type: object + properties: + access_token: + type: string "500": - $ref: "#/responses/500" + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" /logout: post: tags: - Auth - summary: "Logs out the current user." + summary: Logs out the current user. operationId: logout - security: - - BearerAuth: [] - produces: - - application/json responses: "204": - description: "NO CONTENT" + description: NO CONTENT + content: {} "401": - $ref: "#/responses/401" + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" "500": - $ref: "#/responses/500" - -securityDefinitions: - BearerAuth: - type: apiKey - name: Authorization - in: header - description: >- - Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345". + description: + "Internal Server Error - A generic error message, given when\ + \ an unexpected condition was encountered and no more specific message\ + \ is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + security: + - BearerAuth: [] -definitions: - Show: - type: object - required: - - id - - created_at - - updated_at - - title - - start_date - - end_date - - is_live - - enabled - - moderators - properties: - id: - type: integer - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - title: - type: string - body: - type: object - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - is_live: - type: boolean - enabled: - type: boolean - moderators: - type: array - minItems: 1 - items: +components: + schemas: + Show: + required: + - created_at + - enabled + - end_date + - id + - is_live + - moderators + - start_date + - title + - updated_at + type: object + properties: + id: + type: integer + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + title: + type: string + body: type: object - properties: - id: - type: integer - name: - type: string - primary: - type: boolean - locked_by: - type: integer - - Request: - type: object - required: - - id - - name - - message - - created_at - properties: - id: - type: integer - name: - type: string - message: - type: string - created_at: - type: string - format: date-time - - User: - type: object - required: - - id - - created_at - - updated_at - - name - - email - - password - properties: - id: - type: integer - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - name: - type: string - email: - type: string - email_verified_at: - type: string - format: date-time - password: - type: string - format: password - role: - type: integer - - Role: - type: object - required: - - id - - created_at - - updated_at - - name - - permissions - properties: - id: - type: integer - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - name: - type: string - permissions: - type: object - - Error: - type: object - properties: - error: - type: string - example: "Not Found" - status: - type: integer - example: 404 - message: - type: string - example: "The server cannot find the requested resource." - -responses: - 400: - description: >- - Bad Request - The server cannot or will not process the request due to an apparent client error. - schema: - $ref: "#/definitions/Error" - - 401: - description: >- - Unauthorized - The request requires authentication or the user has not been authenticated. - schema: - $ref: "#/definitions/Error" - - 403: - description: >- - Forbidden - The server understood the request, but is refusing to fulfill it. - schema: - $ref: "#/definitions/Error" - - 404: - description: >- - Not Found - The server cannot find the requested resource. - schema: - $ref: "#/definitions/Error" - - 500: - description: >- - Internal Server Error - A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. - schema: - $ref: "#/definitions/Error" + properties: {} + start_date: + type: string + format: date-time + end_date: + type: string + format: date-time + is_live: + type: boolean + enabled: + type: boolean + moderators: + minItems: 1 + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string + primary: + type: boolean + locked_by: + type: integer + Request: + required: + - created_at + - id + - message + - name + type: object + properties: + id: + type: integer + name: + type: string + message: + type: string + created_at: + type: string + format: date-time + User: + required: + - created_at + - email + - id + - name + - password + - updated_at + type: object + properties: + id: + type: integer + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + name: + type: string + email: + type: string + email_verified_at: + type: string + format: date-time + password: + type: string + format: password + role: + type: integer + Role: + required: + - created_at + - id + - name + - permissions + - updated_at + type: object + properties: + id: + type: integer + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + name: + type: string + permissions: + type: object + properties: {} + Error: + type: object + properties: + error: + type: string + example: Not Found + status: + type: integer + example: 404 + message: + type: string + example: The server cannot find the requested resource. + responses: + "400": + description: + Bad Request - The server cannot or will not process the request + due to an apparent client error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: + Unauthorized - The request requires authentication or the user + has not been authenticated. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: + "Forbidden - The server understood the request, but is refusing\ + \ to fulfill it." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found - The server cannot find the requested resource. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: + "Internal Server Error - A generic error message, given when an\ + \ unexpected condition was encountered and no more specific message is suitable." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + securitySchemes: + BearerAuth: + type: apiKey + description: + "Enter the token with the `Bearer: ` prefix, e.g. \"Bearer abcde12345\"\ + ." + name: Authorization + in: header +x-original-swagger-version: "2.0"