v0.1.1
What's new
--diffflag /diffModeconfig 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
diffModeset in the config file is no longer silently overridden when the--diffCLI 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 --diffor via config file:
// openapi2ts.config.js
module.exports = {
schemaPath: './swagger.json',
// ...
diffMode: true,
};Full Changelog: v0.0.10...v0.1.1