openapi: refactor API key endpoints by removing obsolete request body and adding response schemas

This commit is contained in:
juancarmore 2025-06-18 13:39:23 +02:00
parent 419aaecc57
commit 8df8fa216b
4 changed files with 34 additions and 27 deletions

View File

@ -1,19 +0,0 @@
description: Create a new API key.
required: true
content:
application/json:
schema:
type: object
properties:
apiKey:
type: string
description: The API key to be created.
example: "ovmeet-1234567890abcdef1234567890abcdef"
creationDate:
type: string
format: date-time
description: The date and time when the API key was created.
example: "2023-10-01T12:00:00Z"
required:
- apiKey
additionalProperties: false

View File

@ -0,0 +1,14 @@
description: Successfully created a new API key
content:
application/json:
schema:
type: object
properties:
apiKey:
type: string
description: The API key that was created.
example: 'ovmeet-1234567890abcdef1234567890abcdef'
creationDate:
type: number
description: The date when the API key was created.
example: 1620000000000

View File

@ -0,0 +1,16 @@
description: Successfully retrieved API keys
content:
application/json:
schema:
type: array
items:
type: object
properties:
apiKey:
type: string
description: The API key that was created.
example: 'ovmeet-1234567890abcdef1234567890abcdef'
creationDate:
type: number
description: The date when the API key was created.
example: 1620000000000

View File

@ -67,7 +67,7 @@
/auth/api-keys: /auth/api-keys:
post: post:
operationId: createApiKey operationId: createApiKey
summary: Create an API key summary: Create a new API key
description: > description: >
Creates a new API key. Only one API key can be created in the system. Creates a new API key. Only one API key can be created in the system.
If an API key already exists, it will be replaced with the new one. If an API key already exists, it will be replaced with the new one.
@ -76,18 +76,14 @@
- Internal API - Authentication - Internal API - Authentication
security: security:
- accessTokenCookie: [] - accessTokenCookie: []
requestBody:
$ref: '../../components/requestBodies/internal/create-api-key.yaml'
responses: responses:
'201': '201':
$ref: '../../components/responses/internal/success-create-api-key.yaml' $ref: '../../components/responses/internal/success-create-api-key.yaml'
'400':
$ref: '../../components/responses/internal/error-invalid-request.yaml'
'500': '500':
$ref: '../../components/responses/internal-server-error.yaml' $ref: '../../components/responses/internal-server-error.yaml'
get: get:
operationId: getApiKeys operationId: getApiKeys
summary: Get the API keys summary: Get API keys
description: > description: >
Retrieves the existing API keys. Retrieves the existing API keys.
tags: tags:
@ -96,12 +92,12 @@
- accessTokenCookie: [] - accessTokenCookie: []
responses: responses:
'200': '200':
$ref: '../../components/responses/internal/success-get-api-key.yaml' $ref: '../../components/responses/internal/success-get-api-keys.yaml'
'500': '500':
$ref: '../../components/responses/internal-server-error.yaml' $ref: '../../components/responses/internal-server-error.yaml'
delete: delete:
operationId: deleteApiKeys operationId: deleteApiKeys
summary: Delete the API keys summary: Delete API keys
description: > description: >
Deletes the existing API keys. Deletes the existing API keys.
tags: tags: