Post

📢ArkType 2.2 is here. This is a big one, and it's long overdue. Validated functions, type-safe regex, bidirectional JSON Schema, and universal schema interop. Here's what's new 🧵

type.fn Define runtime-validated functions using the same syntax you already know. Defaults, optionals, variadics- it all works.

Type-safe regex via arkregex Regex literals in your definitions now carry full type inference. x-prefix parses capture groups at runtime.

Standard Schema validators can now be embedded directly in ArkType definitions. Zod, Valibot, or anything else that implements the spec.

@ark/json-schema — Bidirectional JSON Schema Parse JSON Schema into ArkType Types, and convert Types to JSON Schema. Huge thanks to @TizzySaurus for building this one. toJsonSchema() now supports configurable fallbacks, draft-07/2020-12 targets, and cyclic types.

0 reposts2 likes

I am correct that now I can convert an OpenAPI spec to a JSON Schema and use the result for TS and runtime validation?