|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [0.12.0] - 2026-03-17 |
| 9 | + |
| 10 | +### Added |
| 11 | +- OpenAPI 3.1 support: handles nullable type arrays (`type: ["string", "null"]`) and `examples` keyword (plural) |
| 12 | +- `OpenApiImport::ParseError` exception class for parse failures (instead of `exit!`) |
| 13 | +- `OpenApiImport::VERSION` constant |
| 14 | +- `return_data` option to get generated code as a Hash without writing files |
| 15 | +- `--version` / `-v` CLI flag |
| 16 | +- `--dry_run` / `-d` CLI flag to preview output without writing files |
| 17 | +- GitHub Actions CI workflow (`.github/workflows/ci.yml`) testing Ruby 3.0-3.4 |
| 18 | +- RuboCop configuration (`.rubocop.yml`) |
| 19 | +- Unit tests for all helper modules (`get_examples`, `get_patterns`, `filter`, `get_required_data`, `pretty_hash_symbolized`, `get_data_all_of_bodies`) |
| 20 | +- Feature tests for `mock_response`, `silent`, error handling, `return_data`, and OAS 3.1 |
| 21 | +- `after(:suite)` cleanup in spec_helper to remove generated test artifacts |
| 22 | +- `CHANGELOG.md` |
| 23 | + |
| 24 | +### Changed |
| 25 | +- **BREAKING**: `exit!` on parse failure replaced with `raise OpenApiImport::ParseError` -- callers should rescue this |
| 26 | +- **BREAKING**: Minimum Ruby version raised from 2.7 to 3.0 |
| 27 | +- `rescue Exception` replaced with `rescue StandardError` throughout (no longer swallows Ctrl-C/OOM) |
| 28 | +- `eval()` calls removed -- replaced with safe hash construction and `load` for file validation |
| 29 | +- `String` monkey-patching (`snake_case`/`camel_case`) replaced with Ruby refinements (`OpenApiImportStringExt`) |
| 30 | +- `include LibOpenApiImport` moved from top-level (global namespace) into `OpenApiImport` class via `extend` |
| 31 | +- Shell commands (`rufo`, `ruby -c`) now use `Shellwords.shellescape` for path safety |
| 32 | +- `activesupport` constraint relaxed from `~> 6.1` to `>= 6.1, < 8.0` (supports Rails 7) |
| 33 | +- `rufo` constraint relaxed from `~> 0.16.1` to `~> 0.16` |
| 34 | +- Input data mutations reduced (non-destructive `gsub` instead of `gsub!`, local variables instead of modifying input hashes) |
| 35 | +- Repeated `rufo` formatting + syntax check code extracted into `format_and_check_file` helper method |
| 36 | +- `kind_of?` standardized to `is_a?`, `.keys.include?` to `.key?` |
| 37 | +- Ruby version comparison uses `Gem::Version` instead of string comparison |
| 38 | +- Output messages now display relative paths (as provided by the user) instead of expanded absolute paths |
| 39 | + |
| 40 | +### Fixed |
| 41 | +- Bug in `get_examples.rb`: `val.include?("'")` was checking hash keys instead of string content |
| 42 | +- Array modification during iteration in `get_required_data.rb` (now collects and concatenates after) |
| 43 | +- `filter.rb`: nil guard added for nested key access (`result[key] ||= {}`) |
| 44 | +- `get_patterns`: simple-type array items (e.g., `{type: "string"}`) now correctly produce `[:'string']` patterns without relying on mutation side-effects from `get_examples` |
| 45 | +- `build_example_value`: array types now recurse into items schema instead of returning empty `[]`, restoring type-hinted examples like `["string"]` and `[{...}]` |
| 46 | + |
| 47 | +### Deprecated |
| 48 | +- Travis CI configuration (`.travis.yml`) -- superseded by GitHub Actions |
0 commit comments