Skip to content
Host your specs. Generate from anywhere.

Developing

The examples folder contains various integration examples that demonstrate how to use @hey-api/openapi-ts with different frameworks and libraries. These examples are kept in sync with the codebase through automated checks.

When you make changes to the core packages that affect code generation, you need to regenerate the client code in all examples:

Terminal window
pnpm examples:generate

This command will:

  • Find all examples with an openapi-ts script
  • Run the OpenAPI code generator for each example
  • Update the generated client code in each example

Before committing changes, ensure that all generated example code is up-to-date:

Terminal window
pnpm examples:check

This command will:

  • Regenerate all example code
  • Check if any files were modified
  • Exit with an error if generated code is out of sync

This check is also run automatically in CI to ensure examples stay in sync with the main codebase.

  1. Make changes to core packages
  2. Build the packages: pnpm build --filter="@hey-api/**"
  3. Regenerate examples: pnpm examples:generate
  4. Commit all changes including the updated generated code
  5. The CI will verify that examples are in sync

We use Changesets to manage releases and generate changelogs. When contributing changes, create a changeset to document your updates.

Run the following command to create a new changeset:

Terminal window
pnpm changeset

This will prompt you to:

  1. Select the packages that were changed
  2. Choose the semver bump type (major, minor, or patch)
  3. Write a summary of your changes

Changesets use the following format:

example.changeset.md
---
"@hey-api/openapi-ts": patch
---
**scope**: description of changes

Scopes:

  • cli, parser, output, config, input, internal, build, error → Core section
  • plugin(name) → Plugins section (e.g., **plugin(zod)**:, **plugin(@hey-api/client-axios)**:)
  • Any other scope → Other section

Breaking Changes:

  • Use **BREAKING**: prefix in the description to mark breaking changes
  • For packages on v0.x (major version 0), minor bumps may include breaking changes. Use signal words like “removed”, “renamed”, or “changed signature” to indicate breaking changes.
example.changeset.md
---
"@hey-api/openapi-ts": patch
---
**parser**: fix explicit discriminator mapping