Skip to content

Commit 5f9bbf0

Browse files
committed
fix reply schema for 5xx
1 parent b19a23c commit 5f9bbf0

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/server/routes/system/health.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type EngineFeature =
1313
| "HETEROGENEOUS_WALLET_TYPES"
1414
| "SMART_BACKEND_WALLETS";
1515

16-
const ReplySchemaOk = Type.Object({
16+
const ReplySchema = Type.Object({
1717
db: Type.Boolean(),
1818
redis: Type.Boolean(),
1919
auth: Type.Boolean(),
@@ -31,15 +31,9 @@ const ReplySchemaOk = Type.Object({
3131
clientId: Type.String(),
3232
});
3333

34-
const ReplySchemaError = Type.Object({
35-
error: Type.String(),
36-
});
37-
38-
const responseBodySchema = Type.Union([ReplySchemaOk, ReplySchemaError]);
39-
4034
export async function healthCheck(fastify: FastifyInstance) {
4135
fastify.route<{
42-
Reply: Static<typeof responseBodySchema>;
36+
Reply: Static<typeof ReplySchema>;
4337
}>({
4438
method: "GET",
4539
url: "/system/health",
@@ -50,8 +44,8 @@ export async function healthCheck(fastify: FastifyInstance) {
5044
tags: ["System"],
5145
operationId: "checkHealth",
5246
response: {
53-
[StatusCodes.OK]: ReplySchemaOk,
54-
[StatusCodes.SERVICE_UNAVAILABLE]: ReplySchemaError,
47+
[StatusCodes.OK]: ReplySchema,
48+
[StatusCodes.SERVICE_UNAVAILABLE]: ReplySchema,
5549
},
5650
},
5751
handler: async (_, res) => {

0 commit comments

Comments
 (0)