Files
codevault/internal/api/openapi.yaml

74 lines
1.6 KiB
YAML

openapi: 3.0.3
info:
title: CodeVault API
version: "1.0.0"
paths:
/api/v1/getValue:
post:
operationId: getValue
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GetValueRequest'
responses:
'200':
description: Value found
content:
application/json:
schema:
$ref: '#/components/schemas/GetValueResponse'
'400':
description: Invalid request body
'404':
description: Value not found
/api/v1/setValue:
post:
operationId: setValue
security:
- basicAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SetValueRequest'
responses:
'204':
description: Value stored
'400':
description: Invalid request body
'401':
description: Missing or invalid credentials
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
schemas:
GetValueRequest:
type: object
required:
- code
properties:
code:
type: string
GetValueResponse:
type: object
required:
- value
properties:
value:
type: string
SetValueRequest:
type: object
required:
- code
- value
properties:
code:
type: string
value:
type: string