openapi: refactor API key endpoints by removing obsolete request body and adding response schemas
This commit is contained in:
parent
419aaecc57
commit
8df8fa216b
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -67,7 +67,7 @@
|
||||
/auth/api-keys:
|
||||
post:
|
||||
operationId: createApiKey
|
||||
summary: Create an API key
|
||||
summary: Create a new API key
|
||||
description: >
|
||||
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.
|
||||
@ -76,18 +76,14 @@
|
||||
- Internal API - Authentication
|
||||
security:
|
||||
- accessTokenCookie: []
|
||||
requestBody:
|
||||
$ref: '../../components/requestBodies/internal/create-api-key.yaml'
|
||||
responses:
|
||||
'201':
|
||||
$ref: '../../components/responses/internal/success-create-api-key.yaml'
|
||||
'400':
|
||||
$ref: '../../components/responses/internal/error-invalid-request.yaml'
|
||||
'500':
|
||||
$ref: '../../components/responses/internal-server-error.yaml'
|
||||
get:
|
||||
operationId: getApiKeys
|
||||
summary: Get the API keys
|
||||
summary: Get API keys
|
||||
description: >
|
||||
Retrieves the existing API keys.
|
||||
tags:
|
||||
@ -96,12 +92,12 @@
|
||||
- accessTokenCookie: []
|
||||
responses:
|
||||
'200':
|
||||
$ref: '../../components/responses/internal/success-get-api-key.yaml'
|
||||
$ref: '../../components/responses/internal/success-get-api-keys.yaml'
|
||||
'500':
|
||||
$ref: '../../components/responses/internal-server-error.yaml'
|
||||
delete:
|
||||
operationId: deleteApiKeys
|
||||
summary: Delete the API keys
|
||||
summary: Delete API keys
|
||||
description: >
|
||||
Deletes the existing API keys.
|
||||
tags:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user