refactor(api): ♻️ Move from @hono/zod-openapi to hono-openapi

hono-openapi is easier to work with and generates better OpenAPI definitions
This commit is contained in:
Jesse Wierzbinski 2025-03-29 03:30:06 +01:00
parent 0576aff972
commit 58342e86e1
No known key found for this signature in database
240 changed files with 9494 additions and 9575 deletions

View file

@ -1,4 +1,4 @@
import { z } from "@hono/zod-openapi";
import { z } from "zod";
import { config } from "~/config.ts";
import { Account } from "./account.ts";
import { Attachment } from "./attachment.ts";
@ -42,10 +42,11 @@ export const Mention = z
},
}),
})
.openapi("Mention", {
.openapi({
externalDocs: {
url: "https://docs.joinmastodon.org/entities/Status/#Mention",
},
ref: "Mention",
});
export const StatusSource = z
@ -75,10 +76,11 @@ export const StatusSource = z
example: "",
}),
})
.openapi("StatusSource", {
.openapi({
externalDocs: {
url: "https://docs.joinmastodon.org/entities/StatusSource",
},
ref: "StatusSource",
});
// Because Status has some recursive references, we need to define it like this
@ -356,7 +358,9 @@ const BaseStatus = z
},
}),
})
.openapi("BaseStatus");
.openapi({
ref: "BaseStatus",
});
export const Status = BaseStatus.extend({
reblog: BaseStatus.nullable().openapi({
@ -366,7 +370,9 @@ export const Status = BaseStatus.extend({
},
}),
quote: BaseStatus.nullable(),
}).openapi("Status");
}).openapi({
ref: "Status",
});
export const ScheduledStatus = z
.object({
@ -414,4 +420,6 @@ export const ScheduledStatus = z
}),
}),
})
.openapi("ScheduledStatus");
.openapi({
ref: "ScheduledStatus",
});