added api docs
This commit is contained in:
19
interface/api/response/error.yaml
Normal file
19
interface/api/response/error.yaml
Normal 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
|
||||
78
interface/api/response/operation.yaml
Normal file
78
interface/api/response/operation.yaml
Normal 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
|
||||
47
interface/api/response/response.yaml
Normal file
47
interface/api/response/response.yaml
Normal 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
|
||||
10
interface/api/response/status.yaml
Normal file
10
interface/api/response/status.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
components:
|
||||
schemas:
|
||||
ApiStatus:
|
||||
type: string
|
||||
description: Unified response status used by backend wrappers.
|
||||
enum:
|
||||
- success
|
||||
- processed
|
||||
- error
|
||||
- request
|
||||
Reference in New Issue
Block a user