in packages/better-auth/src/plugins/open-api/generator.ts [163:263]
function getResponse(responses?: Record<string, any>) {
return {
"400": {
content: {
"application/json": {
schema: {
type: "object",
properties: {
message: {
type: "string",
},
},
required: ["message"],
},
},
},
description:
"Bad Request. Usually due to missing parameters, or invalid parameters.",
},
"401": {
content: {
"application/json": {
schema: {
type: "object",
properties: {
message: {
type: "string",
},
},
required: ["message"],
},
},
},
description: "Unauthorized. Due to missing or invalid authentication.",
},
"403": {
content: {
"application/json": {
schema: {
type: "object",
properties: {
message: {
type: "string",
},
},
},
},
},
description:
"Forbidden. You do not have permission to access this resource or to perform this action.",
},
"404": {
content: {
"application/json": {
schema: {
type: "object",
properties: {
message: {
type: "string",
},
},
},
},
},
description: "Not Found. The requested resource was not found.",
},
"429": {
content: {
"application/json": {
schema: {
type: "object",
properties: {
message: {
type: "string",
},
},
},
},
},
description:
"Too Many Requests. You have exceeded the rate limit. Try again later.",
},
"500": {
content: {
"application/json": {
schema: {
type: "object",
properties: {
message: {
type: "string",
},
},
},
},
},
description:
"Internal Server Error. This is a problem with the server that you cannot fix.",
},
...responses,
} as any;
}