added api docs

This commit is contained in:
Arseni
2026-02-24 21:26:31 +03:00
parent 0646f55189
commit fa54088b25
87 changed files with 2299 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
components:
schemas:
ApiError:
type: object
additionalProperties: false
required:
- code
- error
- source
properties:
code:
type: integer
format: int32
error:
type: string
source:
type: string
details:
type: string

View File

@@ -0,0 +1,78 @@
components:
responses:
Ok:
description: Successful response
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/BaseResponse
Created:
description: Resource created
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/BaseResponse
Accepted:
description: Request accepted for processing
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/BaseResponse
BadRequest:
description: Bad request payload or query/path parameter
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
Forbidden:
description: Forbidden
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
Gone:
description: Resource is no longer available
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
Conflict:
description: Conflict
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
TooManyRequests:
description: Too many requests
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse
InternalServerError:
description: Internal server error
content:
application/json:
schema:
$ref: ./response.yaml#/components/schemas/ErrorResponse

View File

@@ -0,0 +1,47 @@
components:
schemas:
BaseResponse:
type: object
additionalProperties: false
required:
- status
- data
properties:
status:
$ref: ./status.yaml#/components/schemas/ApiStatus
data:
description: Payload for success or error responses.
ErrorResponse:
allOf:
- $ref: ./response.yaml#/components/schemas/BaseResponse
- type: object
properties:
status:
type: string
enum:
- error
data:
$ref: ./error.yaml#/components/schemas/ApiError
SuccessResultData:
type: object
additionalProperties: false
required:
- result
properties:
result:
type: boolean
SuccessResultResponse:
allOf:
- $ref: ./response.yaml#/components/schemas/BaseResponse
- type: object
properties:
status:
type: string
enum:
- success
- processed
data:
$ref: ./response.yaml#/components/schemas/SuccessResultData

View File

@@ -0,0 +1,10 @@
components:
schemas:
ApiStatus:
type: string
description: Unified response status used by backend wrappers.
enum:
- success
- processed
- error
- request