ts-runtime-checks icon indicating copy to clipboard operation
ts-runtime-checks copied to clipboard

[FEATURE] Add introspection support

Open jirutka opened this issue 11 months ago • 1 comments

Is your feature request related to a problem? Please describe.

I’d like to use ts-runtime-checks instead of Valibot (or Zod, Typebox, …) with Hono a Hono OpenAPI, i.e. be able to generate an OpenAPI schema with the request/response/query/param schemas defined using ts-runtime-checks on the fly.

Ideally, I’d like to generate the whole OpenAPI schema in the build time instead of runtime, but this is out-of-scope of this library.

Describe the solution you'd like

Add a function, e.g. introspect<T>(), that will be replaced with a structured representation of the type that can be used by other libraries to do their magic.

Describe alternatives you've considered

Replacing ts-runtime-checks with Valibot. :(

jirutka avatar Jan 20 '25 14:01 jirutka

This is a great idea!

GoogleFeud avatar Jan 20 '25 15:01 GoogleFeud