mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
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:
parent
0576aff972
commit
58342e86e1
240 changed files with 9494 additions and 9575 deletions
|
|
@ -1,8 +1,8 @@
|
|||
// biome-ignore lint/correctness/noUndeclaredDependencies: Dependency of @hono/zod-openapi
|
||||
import type { ResponseConfig } from "@asteasolutions/zod-to-openapi";
|
||||
import { z } from "@hono/zod-openapi";
|
||||
import type { DescribeRouteOptions } from "hono-openapi";
|
||||
import { resolver } from "hono-openapi/zod";
|
||||
import type { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import type { JSONObject } from "hono/utils/types";
|
||||
import { z } from "zod";
|
||||
|
||||
/**
|
||||
* API Error
|
||||
|
|
@ -33,12 +33,12 @@ export class ApiError extends Error {
|
|||
.optional(),
|
||||
});
|
||||
|
||||
public get schema(): ResponseConfig {
|
||||
public get schema(): DescribeRouteOptions["responses"] {
|
||||
return {
|
||||
description: this.message,
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: ApiError.zodSchema,
|
||||
schema: resolver(ApiError.zodSchema),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue