rspec-json_api 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6dbc4d7e9cad6a0077c93be19b454999442378eca8cce7b1496b2a4695014a0
4
- data.tar.gz: 976d1585d20673d2d91b0261242bd56a4290cfed483d085fa27b1f737c03e746
3
+ metadata.gz: b0a09137349ac0fccf09529e902891d26148b10533b62c4d8f7731ba7529b5a3
4
+ data.tar.gz: 79217a3491fb7c081f86b38305574ba201d7710572312f406edb55a939dee8fa
5
5
  SHA512:
6
- metadata.gz: 290773425e56acd72ac1ba7c1c0832216412ba0d7ee974a7817b4fc2c82e4dbb6c6ca14072b13d53c005fd97b2658f3ef160191c8a944a7733ab74d23efb4b37
7
- data.tar.gz: b8e752a18818eb6815e567727d2ce2ba2cd4653c147e2aa6209f43ad3f70a95c8d96ae0b90579a8a56040c4880e9f32f51037bc9ff953963bf3b5625d373be9c
6
+ metadata.gz: d50831bc5a1ea49bd7579524db9f61879f7568982953c1f449a4daa1a2a67b3d2a052a04e079c2bafc140832868497014bfded996d860aa60aa47b03a8f0db9e
7
+ data.tar.gz: 2296ba594e1acf7f9cca856386ac963ec46b0a72b286d50a38a830f3f39ed12b585ee39274af1baf56863f138d84d250820be594ea9868caddbec0a65f139e32
data/CHANGELOG.md CHANGED
@@ -1,28 +1,77 @@
1
- ## [Unreleased]
2
-
3
- ## [1.4.0] - 2026-01-23
4
-
5
- ### Changed
6
- - Updated Ruby version requirement from `>= 3.0.0` to `>= 3.2.0` (required for Rails 8.1 compatibility)
7
- - Maintained Rails compatibility: supports Rails `>= 6.1.4.1` including Rails 8.1
8
- - Maintained ActiveSupport compatibility: supports ActiveSupport `>= 6.1.4.1` including Rails 8.1
9
- - Maintained RSpec Rails compatibility: supports RSpec Rails `>= 5.0.2` (tested with Rails 8.1)
10
- - Updated Bundler from 2.2.19 to 4.0.4 (latest version as of January 2026)
11
- - Updated RuboCop to `~> 1.65` and updated TargetRubyVersion to 3.2
12
- - Updated Rake to `~> 13.2`
13
- - Updated Diffy to `~> 3.4`
14
- - Updated all transitive dependencies to latest compatible versions
15
- - Verified compatibility with Rails 8.1.2 while maintaining support for older Rails versions
16
- - Added `rubygems_mfa_required` metadata for enhanced security
17
- - Updated GitHub Actions CI workflow to use Ruby 3.2.2 and Bundler 4.0.4
18
-
19
- ### Fixed
20
- - Fixed RuboCop style violations (trailing commas, empty literals, symbol proc usage)
21
- - Fixed module function style (changed `extend self` to `module_function`)
22
- - Fixed line endings in Gemfile (CRLF to LF)
23
- - Fixed CI workflow bundler version mismatch
24
- - Fixed README typos and improved code examples consistency
25
-
26
- ## [0.1.0] - 2021-08-24
27
-
28
- - Initial release
1
+ ## [Unreleased]
2
+
3
+ ## [1.6.0] - 2026-09-03
4
+
5
+ ### Fixed
6
+ - A list schema (`[String]`, `[INTERFACE]`) fails the match instead of raising `NoMethodError` when the response holds `null` or a scalar where an array was expected. This affected nested lists too, so an interface element with a scalar in place of a list crashed the example.
7
+ - `Types::URI` is anchored with `\A...\z`. It previously accepted any value that merely contained a URI, so `"see https://example.com for details"` matched. `EMAIL` and `UUID` were already anchored. Suites that relied on the substring behaviour will start failing.
8
+ - `match_json_schema` fails with `expected a JSON String to match against the schema, got NilClass` instead of raising `TypeError` when handed `nil`, an already-parsed Hash, or any other non-String.
9
+ - A schema `Proc` that returns something other than an options Hash, or that expects the value as an argument, raises a descriptive `ArgumentError` naming the mistake. Both previously surfaced as a bare `NoMethodError` or `wrong number of arguments` from inside the matcher.
10
+ - An object schema compared against array elements of another shape (`[{ id: Integer }]` against `["a", "b"]`) fails instead of raising `NoMethodError`. This is the same class of bug as the list-schema crash above, on the object comparison path.
11
+ - `expect(body).not_to match_json_schema(schema)` fails when the body is not a JSON String, rather than passing by default. A type error in the spec is now a failure whichever way the expectation is written.
12
+ - A non-lambda `proc { |value| ... }` used as a schema Proc is rejected alongside the lambda form. Ruby reports a non-lambda block parameter as optional, so the check reads the parameter list rather than the arity; a Proc declaring an optional parameter is rejected for the same reason.
13
+ - The `have_no_content` specs gave every body its own context. A repeated `let(:actual)` in one context meant the `"{}"` case never ran.
14
+
15
+ ### Changed
16
+ - The released gem contains the tracked files under `lib/` plus the licence, the README and the CHANGELOG, and nothing else. It previously packaged the repository's own tooling: the CI workflow, the RuboCop config, the Gemfile and lockfile, the Rakefile, `bin/` and `gemfiles/`. Scoping the file list to tracked paths also keeps an untracked local file in `lib/` out of a release.
17
+ - README regex examples anchor with `\A` and `\z` instead of `^` and `$`, with a note explaining that the line-boundary anchors let a multi-line value satisfy a schema.
18
+ - Updated the locked development dependencies past every advisory `bundler-audit` reported: rack, nokogiri, railties, activesupport, concurrent-ruby, loofah, crass, erb, json, rails-html-sanitizer and rack-session.
19
+
20
+ ### Added
21
+ - Exact-array schemas dispatch each element the same way any other schema value is dispatched, so `[Integer, Integer]` is a fixed-length tuple and `[RSpec::JsonApi::Types::URI]` type-checks its single element. Elements were previously compared with `==`, so a Class, Regexp or Proc in that position could never match.
22
+ - A `bundler-audit` job in CI, a Dependabot config for bundler and github-actions, and `permissions: contents: read` on the workflow.
23
+ - `ROADMAP.md`, the prioritised findings from a full review of the codebase.
24
+
25
+ ## [1.5.0] - 2026-06-05
26
+
27
+ ### Added
28
+ - CI compatibility matrix across Ruby 3.2-3.4 and Rails 6.1, 7.1, 7.2, 8.0 and 8.1 (`gemfiles/` + GitHub Actions matrix), so the advertised version support is actually tested.
29
+ - `RSpec::JsonApi::Constraints` module encapsulating the schema `Proc` options DSL.
30
+ - `RSpec::JsonApi::SchemaMatch` as the single comparison entry point, and `RSpec::JsonApi::Traversal` for the internal structural helpers.
31
+
32
+ ### Changed
33
+ - Depend on `railties` instead of the full `rails` meta-gem; the gem only uses ActiveSupport core extensions and `Rails::Generators`. Drops the dependency graph from 87 to 65 gems. The `>= 6.1.4.1` floor is unchanged.
34
+ - Unified array and hash comparison behind `SchemaMatch`; removed the duplicate `CompareArray` and `CompareHash` modules.
35
+ - Stopped monkey-patching core `Hash`/`Array`; `deep_keys`, `deep_key_paths`, `deep_sort` and `sanitize!` moved into the internal `Traversal` module.
36
+ - The failure diff is now built lazily, only when a match fails.
37
+ - An unsupported schema `Proc` option now raises `ArgumentError` instead of being silently ignored.
38
+ - Generators emit `# frozen_string_literal: true` and freeze the generated interface hash.
39
+
40
+ ### Fixed
41
+ - Require `uri` so the built-in types load on Ruby 4.0 (previously raised `NameError` on load).
42
+ - Anchor the `UUID` type with `\A...\z` so multiline strings no longer pass validation.
43
+ - Rescue invalid JSON in `match_json_schema` instead of raising `JSON::ParserError`.
44
+ - Avoid a `TypeError` when a schema expects a nested object but the actual value is a scalar.
45
+ - Enforce key structure for interface-array elements; an element with an extra null-valued key no longer matches.
46
+ - Reset the memoized diff at the start of `matches?` so a reused matcher reflects the current actual value.
47
+ - Use `Regexp#match?` for regex comparison so it returns a Boolean instead of a match index.
48
+
49
+ ### Removed
50
+ - Dead/broken `interface.erb` generator template.
51
+
52
+ ## [1.4.0] - 2026-01-23
53
+
54
+ ### Changed
55
+ - Updated Ruby version requirement from `>= 3.0.0` to `>= 3.2.0` (required for Rails 8.1 compatibility)
56
+ - Maintained Rails compatibility: supports Rails `>= 6.1.4.1` including Rails 8.1
57
+ - Maintained ActiveSupport compatibility: supports ActiveSupport `>= 6.1.4.1` including Rails 8.1
58
+ - Maintained RSpec Rails compatibility: supports RSpec Rails `>= 5.0.2` (tested with Rails 8.1)
59
+ - Updated Bundler from 2.2.19 to 4.0.4 (latest version as of January 2026)
60
+ - Updated RuboCop to `~> 1.65` and updated TargetRubyVersion to 3.2
61
+ - Updated Rake to `~> 13.2`
62
+ - Updated Diffy to `~> 3.4`
63
+ - Updated all transitive dependencies to latest compatible versions
64
+ - Verified compatibility with Rails 8.1.2 while maintaining support for older Rails versions
65
+ - Added `rubygems_mfa_required` metadata for enhanced security
66
+ - Updated GitHub Actions CI workflow to use Ruby 3.2.2 and Bundler 4.0.4
67
+
68
+ ### Fixed
69
+ - Fixed RuboCop style violations (trailing commas, empty literals, symbol proc usage)
70
+ - Fixed module function style (changed `extend self` to `module_function`)
71
+ - Fixed line endings in Gemfile (CRLF to LF)
72
+ - Fixed CI workflow bundler version mismatch
73
+ - Fixed README typos and improved code examples consistency
74
+
75
+ ## [0.1.0] - 2021-08-24
76
+
77
+ - Initial release