Osury - OpenAPI 3.x → ReScript codegen with Sury schemas

Excited to share osury — an open-source CLI tool that generates ReScript types with Sury schemas from OpenAPI specifications.

If you work with OpenAPI and ReScript, you know how tedious it is to manually keep your types in sync with the API spec. osury automates this — point it at your OpenAPI 3.x file and get type-safe ReScript code with runtime validation out of the box.

Key features:

  • OpenAPI 3.x → ReScript types with automatic validation schemas
  • Discriminated unions with @tag (Effect TS compatible)
  • Full TypeScript interop via genType
  • Proper null handling — T | null in TypeScript, not undefined
  • Response types from API paths

Getting started:

npx osury openapi.json src/API.res

GitHub: github.com/greenteamer/osury

The project is still in its early stages, and I’d love to hear your feedback. Contributions and suggestions are very welcome!

Built on top of the amazing Sury library by @DZakh.

4 Likes