Я реализовал документацию Swagger для API. Существует несколько кодов ответов для всех API, таких как - 000, 103, 130, 178, 158 и т. Д. Около 50 кодов ответов.
Я реализовал их для всех API. Но есть повторение всех этих 50 кодов ответов во всех API.
Я хочу знать, есть ли хороший способ сделать это.
Ниже приведен образец документации -
/endpoint:
post:
tags:
- "tag1"
summary: "My Request"
description: "My Request description"
operationId: "Op1"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "My request"
required: true
schema:
$ref: "#/definitions/MyRequest"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/MyResponse"
000:
description: "Approval"
103:
description: "Invalid status value"
130:
description: "Invalid Format"
178:
description: "Original request not found"
158:
description: "Invalid processing code"
161:
description: "Withdrawal limit exceeded"
191:
description: "Destination not available"
194:
description: "Duplicate transaction"
196:
description: "System error"
201:
description: "Contact Card Issuer"
205:
description: "Contact Card Issuer2"
/endpoint2:
post:
tags:
- "tag2"
summary: "My Request2"
description: "My Request description2"
operationId: "Op2"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Myrequest"
required: true
schema:
$ref: "#/definitions/MyRequest2"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/MyResponse2"
000:
description: "Approval"
103:
description: "Invalid status value"
130:
description: "Invalid Format"
178:
description: "Original request not found"
158:
description: "Invalid processing code"
161:
description: "Withdrawal limit exceeded"
191:
description: "Destination not available"
194:
description: "Duplicate transaction"
196:
description: "System error"
201:
description: "Contact Card Issuer"
205:
description: "Contact Card Issuer2"