mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 11:29:42 +00:00
feat(api-docs): add error responses to API documentation
This commit is contained in:
@@ -27,6 +27,44 @@ export const integrationAuthPubSchema = IntegrationAuthsSchema.pick({
|
||||
updatedAt: true
|
||||
});
|
||||
|
||||
export const DefaultResponseErrorsSchema = {
|
||||
400: z.object({
|
||||
statusCode: z.literal(400),
|
||||
message: z.literal(
|
||||
`<string>: Contains a human-readable message about what went wrong. 400 errors are bad request errors, and are will occur to happen when passing or unexpected bad data in the request`
|
||||
),
|
||||
error: z.literal(`<string>: Contains a human-readable error name.`)
|
||||
}),
|
||||
404: z.object({
|
||||
statusCode: z.literal(404),
|
||||
message: z.literal(
|
||||
`<string>: Contains a human-readable message about what went wrong. 404 errors are not found errors, and will occur when a resource is not found`
|
||||
),
|
||||
error: z.literal(`<string>: Contains a human-readable error name.`)
|
||||
}),
|
||||
401: z.object({
|
||||
statusCode: z.literal(401),
|
||||
message: z.literal(
|
||||
`<string>: Contains a human-readable message about what went wrong. 401 errors are unauthorized errors, and will occur when attempting to access a resource with invalid or missing credentials`
|
||||
),
|
||||
error: z.literal(`<string>: Contains a human-readable error name.`)
|
||||
}),
|
||||
403: z.object({
|
||||
statusCode: z.literal(403),
|
||||
message: z.literal(
|
||||
`<string>: Contains a human-readable message about what went wrong. 403 errors are forbidden errors, and will occur when attempting to access a resource without the necessary permissions`
|
||||
),
|
||||
error: z.literal(`<string>: Contains a human-readable error name.`)
|
||||
}),
|
||||
500: z.object({
|
||||
statusCode: z.literal(500),
|
||||
message: z.literal(
|
||||
`<string>: Contains a human-readable message about what went wrong. 500 errors are internal server errors, and will occur when an unexpected error occurs on the server`
|
||||
),
|
||||
error: z.literal(`<string>: Contains a human-readable error name.`)
|
||||
})
|
||||
};
|
||||
|
||||
export const sapPubSchema = SecretApprovalPoliciesSchema.merge(
|
||||
z.object({
|
||||
environment: z.object({
|
||||
|
||||
Reference in New Issue
Block a user