Skip to content

v0.1.1

Choose a tag to compare

@unique01082 unique01082 released this 13 Aug 08:49
· 29 commits to main since this release

What's new

  • --diff flag / diffMode config option (#1, thanks @yuko-9k!): before generating, compares the current OpenAPI spec against a saved snapshot and prints a colored report of added/removed/modified APIs (params, body, response types). If any API would be removed, you'll be prompted to confirm before files are regenerated.

Fixes on top of the original contribution

  • diffMode set in the config file is no longer silently overridden when the --diff CLI flag is absent.
  • Snapshot files are now namespaced per schemaPath (.openapi-snapshot.<hash>.json), so projects with multiple configs/schemas no longer overwrite each other's snapshot.
  • The removal-confirmation prompt now safely aborts instead of hanging when there's no interactive terminal (e.g. CI pipelines).

Usage

api2ts --diff

or via config file:

// openapi2ts.config.js
module.exports = {
  schemaPath: './swagger.json',
  // ...
  diffMode: true,
};

Full Changelog: v0.0.10...v0.1.1