Skip to content

Commit

Permalink
docs: add missing JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
paolostyle committed Nov 2, 2024
1 parent a2c64c1 commit 5a50697
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export type StatusCodeWithWildcards =
| `${StatusCodePrefix}XX`
| 'default';

/**
* Mapping of zod-validator targets to their respective schemas, used both as a source of truth
* for validation and for OpenAPI documentation.
*/
export type HonoOpenApiRequestSchemas = Partial<
Record<RequestParam, ValidationTargetParams<AnyZ> | AnyZ>
>;
Expand Down Expand Up @@ -120,6 +124,9 @@ interface SimpleResponseObject
mediaType?: string;
}

/**
* OpenAPI response object, augmented with Zod-based schema.
*/
export type HonoOpenApiResponseObject =
| ZodOpenApiResponseObject
| SimpleResponseObject
Expand All @@ -141,6 +148,10 @@ export interface HonoOpenApiOperation<
responses: HonoOpenApiResponses;
}

/**
* zod-openapi document without `openapi` property (set to 3.1.0, we do not support lower versions).
* @see https://swagger.io/specification/
*/
export type HonoOpenApiDocument = Omit<ZodOpenApiObject, 'openapi'>;

export type HonoOpenApiMiddleware = <
Expand Down

0 comments on commit 5a50697

Please sign in to comment.