rspec-json_api 1.3.1 → 1.5.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 +4 -4
- data/.gitattributes +28 -0
- data/.github/workflows/main.yml +39 -14
- data/.gitignore +6 -0
- data/.rubocop.yml +29 -1
- data/CHANGELOG.md +50 -0
- data/Gemfile +6 -5
- data/Gemfile.lock +143 -174
- data/README.md +11 -11
- data/gemfiles/rails_6_1.gemfile +7 -0
- data/gemfiles/rails_7_1.gemfile +7 -0
- data/gemfiles/rails_7_2.gemfile +7 -0
- data/gemfiles/rails_8_0.gemfile +7 -0
- data/gemfiles/rails_8_1.gemfile +7 -0
- data/lib/generators/rspec/json_api/interface/interface_generator.rb +3 -1
- data/lib/generators/rspec/json_api/type/type_generator.rb +3 -1
- data/lib/rspec/json_api/constraints.rb +56 -0
- data/lib/rspec/json_api/matchers/match_json_schema.rb +14 -11
- data/lib/rspec/json_api/schema_match.rb +135 -0
- data/lib/rspec/json_api/traversal.rb +49 -0
- data/lib/rspec/json_api/types/uuid.rb +1 -1
- data/lib/rspec/json_api/version.rb +1 -1
- data/lib/rspec/json_api.rb +5 -7
- data/rspec-json_api.gemspec +8 -3
- metadata +15 -14
- data/lib/extentions/array.rb +0 -8
- data/lib/extentions/hash.rb +0 -36
- data/lib/generators/rspec/json_api/interface/templates/interface.erb +0 -9
- data/lib/rspec/json_api/compare_array.rb +0 -39
- data/lib/rspec/json_api/compare_hash.rb +0 -114
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6be977d812080cea5feea8a9c9a0a429196c43c06b2aa64e0e742a44e0eb66fd
|
|
4
|
+
data.tar.gz: 77d21174747915fb1c33607eb331e4cfbd8ae9ed9dfa13936bd1cf2436de41af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea7471b8cb4ed9e871917ec51f61426931c765f2c0c46f4bd0c2c5291b3af1fecd855646847897608eace564f734337d34290551b7fca82181b37f9a2eb856da
|
|
7
|
+
data.tar.gz: ef41fe2e7c32dfc6b605cfce7f847ef48a7c0f84878c32ca72178923a0f53e6f556541ef5d28cddb1cd795dc061be7016fa7970266ef369b3f0c693ffb41d9e7
|
data/.gitattributes
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Set default line ending behavior for all files
|
|
2
|
+
* text=lf
|
|
3
|
+
|
|
4
|
+
# Explicitly declare text files you want to always be normalized and converted
|
|
5
|
+
# to native line endings on checkout.
|
|
6
|
+
*.rb text=lf
|
|
7
|
+
*.rake text=lf
|
|
8
|
+
*.gemspec text=lf
|
|
9
|
+
Gemfile text=lf
|
|
10
|
+
Gemfile.lock text=lf
|
|
11
|
+
Rakefile text=lf
|
|
12
|
+
*.md text=lf
|
|
13
|
+
*.yml text=lf
|
|
14
|
+
*.yaml text=lf
|
|
15
|
+
*.json text=lf
|
|
16
|
+
*.txt text=lf
|
|
17
|
+
*.sh text=lf
|
|
18
|
+
|
|
19
|
+
# Denote all files that are truly binary and should not be modified.
|
|
20
|
+
*.png binary
|
|
21
|
+
*.jpg binary
|
|
22
|
+
*.jpeg binary
|
|
23
|
+
*.gif binary
|
|
24
|
+
*.ico binary
|
|
25
|
+
*.pdf binary
|
|
26
|
+
*.zip binary
|
|
27
|
+
*.tar binary
|
|
28
|
+
*.gz binary
|
data/.github/workflows/main.yml
CHANGED
|
@@ -1,20 +1,45 @@
|
|
|
1
1
|
name: Ruby
|
|
2
2
|
|
|
3
|
-
on: [push,pull_request]
|
|
3
|
+
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
|
-
|
|
6
|
+
test:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
|
+
name: "rspec — Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}"
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
# Covers the supported range from the floor (Ruby 3.2 / Rails 6.1) to
|
|
13
|
+
# the current ceiling (Ruby 3.4 / Rails 8.1). Curated pairs avoid
|
|
14
|
+
# Ruby/Rails combinations that are not mutually supported.
|
|
15
|
+
include:
|
|
16
|
+
- { ruby: "3.2", gemfile: rails_6_1 }
|
|
17
|
+
- { ruby: "3.2", gemfile: rails_7_1 }
|
|
18
|
+
- { ruby: "3.3", gemfile: rails_7_2 }
|
|
19
|
+
- { ruby: "3.3", gemfile: rails_8_0 }
|
|
20
|
+
- { ruby: "3.4", gemfile: rails_8_0 }
|
|
21
|
+
- { ruby: "3.4", gemfile: rails_8_1 }
|
|
22
|
+
env:
|
|
23
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
|
8
24
|
steps:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- name: Set up Ruby
|
|
27
|
+
uses: ruby/setup-ruby@v1
|
|
28
|
+
with:
|
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
|
30
|
+
bundler-cache: true
|
|
31
|
+
- name: Run rspec
|
|
32
|
+
run: bundle exec rspec
|
|
33
|
+
|
|
34
|
+
lint:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
name: rubocop
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
- name: Set up Ruby
|
|
40
|
+
uses: ruby/setup-ruby@v1
|
|
41
|
+
with:
|
|
42
|
+
ruby-version: "3.2"
|
|
43
|
+
bundler-cache: true
|
|
44
|
+
- name: Run rubocop
|
|
45
|
+
run: bundle exec rubocop
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
# Append to (rather than replace) RuboCop's default AllCops/Exclude, so the
|
|
2
|
+
# defaults such as vendor/**/* stay excluded. Without this, CI installs gems
|
|
3
|
+
# into vendor/bundle (bundler-cache) and RuboCop would lint third-party gems.
|
|
4
|
+
inherit_mode:
|
|
5
|
+
merge:
|
|
6
|
+
- Exclude
|
|
7
|
+
|
|
1
8
|
AllCops:
|
|
2
|
-
TargetRubyVersion: 3.
|
|
9
|
+
TargetRubyVersion: 3.2
|
|
10
|
+
NewCops: enable
|
|
11
|
+
SuggestExtensions: false
|
|
12
|
+
Exclude:
|
|
13
|
+
- "README.md"
|
|
14
|
+
- "vendor/**/*"
|
|
15
|
+
- "gemfiles/vendor/**/*"
|
|
3
16
|
|
|
4
17
|
Style/StringLiterals:
|
|
5
18
|
Enabled: true
|
|
@@ -11,3 +24,18 @@ Style/StringLiteralsInInterpolation:
|
|
|
11
24
|
|
|
12
25
|
Layout/LineLength:
|
|
13
26
|
Max: 120
|
|
27
|
+
|
|
28
|
+
Metrics/BlockLength:
|
|
29
|
+
Exclude:
|
|
30
|
+
- "spec/**/*_spec.rb"
|
|
31
|
+
|
|
32
|
+
Style/Documentation:
|
|
33
|
+
Enabled: false
|
|
34
|
+
|
|
35
|
+
Naming/PredicatePrefix:
|
|
36
|
+
Exclude:
|
|
37
|
+
- "lib/rspec/json_api/matchers.rb"
|
|
38
|
+
|
|
39
|
+
Naming/PredicateMethod:
|
|
40
|
+
Exclude:
|
|
41
|
+
- "lib/rspec/json_api/schema_match.rb"
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.5.0] - 2026-06-05
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- 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.
|
|
7
|
+
- `RSpec::JsonApi::Constraints` module encapsulating the schema `Proc` options DSL.
|
|
8
|
+
- `RSpec::JsonApi::SchemaMatch` as the single comparison entry point, and `RSpec::JsonApi::Traversal` for the internal structural helpers.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- 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.
|
|
12
|
+
- Unified array and hash comparison behind `SchemaMatch`; removed the duplicate `CompareArray` and `CompareHash` modules.
|
|
13
|
+
- Stopped monkey-patching core `Hash`/`Array`; `deep_keys`, `deep_key_paths`, `deep_sort` and `sanitize!` moved into the internal `Traversal` module.
|
|
14
|
+
- The failure diff is now built lazily, only when a match fails.
|
|
15
|
+
- An unsupported schema `Proc` option now raises `ArgumentError` instead of being silently ignored.
|
|
16
|
+
- Generators emit `# frozen_string_literal: true` and freeze the generated interface hash.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Require `uri` so the built-in types load on Ruby 4.0 (previously raised `NameError` on load).
|
|
20
|
+
- Anchor the `UUID` type with `\A...\z` so multiline strings no longer pass validation.
|
|
21
|
+
- Rescue invalid JSON in `match_json_schema` instead of raising `JSON::ParserError`.
|
|
22
|
+
- Avoid a `TypeError` when a schema expects a nested object but the actual value is a scalar.
|
|
23
|
+
- Enforce key structure for interface-array elements; an element with an extra null-valued key no longer matches.
|
|
24
|
+
- Reset the memoized diff at the start of `matches?` so a reused matcher reflects the current actual value.
|
|
25
|
+
- Use `Regexp#match?` for regex comparison so it returns a Boolean instead of a match index.
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
- Dead/broken `interface.erb` generator template.
|
|
29
|
+
|
|
30
|
+
## [1.4.0] - 2026-01-23
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- Updated Ruby version requirement from `>= 3.0.0` to `>= 3.2.0` (required for Rails 8.1 compatibility)
|
|
34
|
+
- Maintained Rails compatibility: supports Rails `>= 6.1.4.1` including Rails 8.1
|
|
35
|
+
- Maintained ActiveSupport compatibility: supports ActiveSupport `>= 6.1.4.1` including Rails 8.1
|
|
36
|
+
- Maintained RSpec Rails compatibility: supports RSpec Rails `>= 5.0.2` (tested with Rails 8.1)
|
|
37
|
+
- Updated Bundler from 2.2.19 to 4.0.4 (latest version as of January 2026)
|
|
38
|
+
- Updated RuboCop to `~> 1.65` and updated TargetRubyVersion to 3.2
|
|
39
|
+
- Updated Rake to `~> 13.2`
|
|
40
|
+
- Updated Diffy to `~> 3.4`
|
|
41
|
+
- Updated all transitive dependencies to latest compatible versions
|
|
42
|
+
- Verified compatibility with Rails 8.1.2 while maintaining support for older Rails versions
|
|
43
|
+
- Added `rubygems_mfa_required` metadata for enhanced security
|
|
44
|
+
- Updated GitHub Actions CI workflow to use Ruby 3.2.2 and Bundler 4.0.4
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
- Fixed RuboCop style violations (trailing commas, empty literals, symbol proc usage)
|
|
48
|
+
- Fixed module function style (changed `extend self` to `module_function`)
|
|
49
|
+
- Fixed line endings in Gemfile (CRLF to LF)
|
|
50
|
+
- Fixed CI workflow bundler version mismatch
|
|
51
|
+
- Fixed README typos and improved code examples consistency
|
|
52
|
+
|
|
3
53
|
## [0.1.0] - 2021-08-24
|
|
4
54
|
|
|
5
55
|
- Initial release
|
data/Gemfile
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Bundler version: 4.0.4 (see Gemfile.lock BUNDLED WITH section)
|
|
3
4
|
source "https://rubygems.org"
|
|
4
5
|
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
6
|
|
|
6
7
|
# Specify your gem's dependencies in rspec-json_api.gemspec
|
|
7
8
|
gemspec
|
|
8
9
|
|
|
9
|
-
gem "activesupport", "
|
|
10
|
-
gem "diffy"
|
|
11
|
-
gem "rake", "~> 13.
|
|
12
|
-
gem "rspec-rails", "
|
|
13
|
-
gem "rubocop"
|
|
10
|
+
gem "activesupport", ">= 6.1.4.1"
|
|
11
|
+
gem "diffy", "~> 3.4"
|
|
12
|
+
gem "rake", "~> 13.2"
|
|
13
|
+
gem "rspec-rails", ">= 5.0.2"
|
|
14
|
+
gem "rubocop", "~> 1.65"
|
data/Gemfile.lock
CHANGED
|
@@ -1,213 +1,182 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rspec-json_api (1.
|
|
4
|
+
rspec-json_api (1.5.0)
|
|
5
5
|
activesupport (>= 6.1.4.1)
|
|
6
6
|
diffy (>= 3.4.2)
|
|
7
|
-
|
|
7
|
+
railties (>= 6.1.4.1)
|
|
8
8
|
rspec-rails (>= 5.0.2)
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
activesupport (=
|
|
16
|
-
nio4r (~> 2.0)
|
|
17
|
-
websocket-driver (>= 0.6.1)
|
|
18
|
-
actionmailbox (6.1.4.4)
|
|
19
|
-
actionpack (= 6.1.4.4)
|
|
20
|
-
activejob (= 6.1.4.4)
|
|
21
|
-
activerecord (= 6.1.4.4)
|
|
22
|
-
activestorage (= 6.1.4.4)
|
|
23
|
-
activesupport (= 6.1.4.4)
|
|
24
|
-
mail (>= 2.7.1)
|
|
25
|
-
actionmailer (6.1.4.4)
|
|
26
|
-
actionpack (= 6.1.4.4)
|
|
27
|
-
actionview (= 6.1.4.4)
|
|
28
|
-
activejob (= 6.1.4.4)
|
|
29
|
-
activesupport (= 6.1.4.4)
|
|
30
|
-
mail (~> 2.5, >= 2.5.4)
|
|
31
|
-
rails-dom-testing (~> 2.0)
|
|
32
|
-
actionpack (6.1.4.4)
|
|
33
|
-
actionview (= 6.1.4.4)
|
|
34
|
-
activesupport (= 6.1.4.4)
|
|
35
|
-
rack (~> 2.0, >= 2.0.9)
|
|
36
|
-
rack-test (>= 0.6.3)
|
|
37
|
-
rails-dom-testing (~> 2.0)
|
|
38
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
39
|
-
actiontext (6.1.4.4)
|
|
40
|
-
actionpack (= 6.1.4.4)
|
|
41
|
-
activerecord (= 6.1.4.4)
|
|
42
|
-
activestorage (= 6.1.4.4)
|
|
43
|
-
activesupport (= 6.1.4.4)
|
|
13
|
+
actionpack (8.1.2)
|
|
14
|
+
actionview (= 8.1.2)
|
|
15
|
+
activesupport (= 8.1.2)
|
|
44
16
|
nokogiri (>= 1.8.5)
|
|
45
|
-
|
|
46
|
-
|
|
17
|
+
rack (>= 2.2.4)
|
|
18
|
+
rack-session (>= 1.0.1)
|
|
19
|
+
rack-test (>= 0.6.3)
|
|
20
|
+
rails-dom-testing (~> 2.2)
|
|
21
|
+
rails-html-sanitizer (~> 1.6)
|
|
22
|
+
useragent (~> 0.16)
|
|
23
|
+
actionview (8.1.2)
|
|
24
|
+
activesupport (= 8.1.2)
|
|
47
25
|
builder (~> 3.1)
|
|
48
|
-
erubi (~> 1.
|
|
49
|
-
rails-dom-testing (~> 2.
|
|
50
|
-
rails-html-sanitizer (~> 1.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
activemodel (= 6.1.4.4)
|
|
58
|
-
activesupport (= 6.1.4.4)
|
|
59
|
-
activestorage (6.1.4.4)
|
|
60
|
-
actionpack (= 6.1.4.4)
|
|
61
|
-
activejob (= 6.1.4.4)
|
|
62
|
-
activerecord (= 6.1.4.4)
|
|
63
|
-
activesupport (= 6.1.4.4)
|
|
64
|
-
marcel (~> 1.0.0)
|
|
65
|
-
mini_mime (>= 1.1.0)
|
|
66
|
-
activesupport (6.1.4.4)
|
|
67
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
26
|
+
erubi (~> 1.11)
|
|
27
|
+
rails-dom-testing (~> 2.2)
|
|
28
|
+
rails-html-sanitizer (~> 1.6)
|
|
29
|
+
activesupport (8.1.2)
|
|
30
|
+
base64
|
|
31
|
+
bigdecimal
|
|
32
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
33
|
+
connection_pool (>= 2.2.5)
|
|
34
|
+
drb
|
|
68
35
|
i18n (>= 1.6, < 2)
|
|
36
|
+
json
|
|
37
|
+
logger (>= 1.4.2)
|
|
69
38
|
minitest (>= 5.1)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
39
|
+
securerandom (>= 0.3)
|
|
40
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
41
|
+
uri (>= 0.13.1)
|
|
42
|
+
ast (2.4.3)
|
|
43
|
+
base64 (0.3.0)
|
|
44
|
+
bigdecimal (4.0.1)
|
|
45
|
+
builder (3.3.0)
|
|
46
|
+
concurrent-ruby (1.3.6)
|
|
47
|
+
connection_pool (3.0.2)
|
|
76
48
|
crass (1.0.6)
|
|
77
|
-
date (3.
|
|
78
|
-
diff-lcs (1.
|
|
79
|
-
diffy (3.4.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
i18n (1.
|
|
49
|
+
date (3.5.1)
|
|
50
|
+
diff-lcs (1.6.2)
|
|
51
|
+
diffy (3.4.4)
|
|
52
|
+
drb (2.2.3)
|
|
53
|
+
erb (6.0.1)
|
|
54
|
+
erubi (1.13.1)
|
|
55
|
+
i18n (1.14.8)
|
|
84
56
|
concurrent-ruby (~> 1.0)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
57
|
+
io-console (0.8.2)
|
|
58
|
+
irb (1.16.0)
|
|
59
|
+
pp (>= 0.6.0)
|
|
60
|
+
rdoc (>= 4.0.0)
|
|
61
|
+
reline (>= 0.4.2)
|
|
62
|
+
json (2.18.0)
|
|
63
|
+
language_server-protocol (3.17.0.5)
|
|
64
|
+
lint_roller (1.1.0)
|
|
65
|
+
logger (1.7.0)
|
|
66
|
+
loofah (2.25.0)
|
|
88
67
|
crass (~> 1.0.2)
|
|
89
|
-
nokogiri (>= 1.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
marcel (1.0.2)
|
|
96
|
-
method_source (1.0.0)
|
|
97
|
-
mini_mime (1.1.5)
|
|
98
|
-
mini_portile2 (2.7.1)
|
|
99
|
-
minitest (5.15.0)
|
|
100
|
-
net-imap (0.4.9.1)
|
|
101
|
-
date
|
|
102
|
-
net-protocol
|
|
103
|
-
net-pop (0.1.2)
|
|
104
|
-
net-protocol
|
|
105
|
-
net-protocol (0.2.2)
|
|
106
|
-
timeout
|
|
107
|
-
net-smtp (0.4.0.1)
|
|
108
|
-
net-protocol
|
|
109
|
-
nio4r (2.7.0)
|
|
110
|
-
nokogiri (1.13.1)
|
|
111
|
-
mini_portile2 (~> 2.7.0)
|
|
68
|
+
nokogiri (>= 1.12.0)
|
|
69
|
+
minitest (6.0.1)
|
|
70
|
+
prism (~> 1.5)
|
|
71
|
+
nokogiri (1.19.0-arm64-darwin)
|
|
72
|
+
racc (~> 1.4)
|
|
73
|
+
nokogiri (1.19.0-x86_64-darwin)
|
|
112
74
|
racc (~> 1.4)
|
|
113
|
-
|
|
114
|
-
|
|
75
|
+
nokogiri (1.19.0-x86_64-linux-gnu)
|
|
76
|
+
racc (~> 1.4)
|
|
77
|
+
parallel (1.27.0)
|
|
78
|
+
parser (3.3.10.1)
|
|
115
79
|
ast (~> 2.4.1)
|
|
116
80
|
racc
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
rails-dom-testing (2.0.3)
|
|
137
|
-
activesupport (>= 4.2.0)
|
|
81
|
+
pp (0.6.3)
|
|
82
|
+
prettyprint
|
|
83
|
+
prettyprint (0.2.0)
|
|
84
|
+
prism (1.8.0)
|
|
85
|
+
psych (5.3.1)
|
|
86
|
+
date
|
|
87
|
+
stringio
|
|
88
|
+
racc (1.8.1)
|
|
89
|
+
rack (3.2.4)
|
|
90
|
+
rack-session (2.1.1)
|
|
91
|
+
base64 (>= 0.1.0)
|
|
92
|
+
rack (>= 3.0.0)
|
|
93
|
+
rack-test (2.2.0)
|
|
94
|
+
rack (>= 1.3)
|
|
95
|
+
rackup (2.3.1)
|
|
96
|
+
rack (>= 3)
|
|
97
|
+
rails-dom-testing (2.3.0)
|
|
98
|
+
activesupport (>= 5.0.0)
|
|
99
|
+
minitest
|
|
138
100
|
nokogiri (>= 1.6)
|
|
139
|
-
rails-html-sanitizer (1.
|
|
140
|
-
loofah (~> 2.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
101
|
+
rails-html-sanitizer (1.6.2)
|
|
102
|
+
loofah (~> 2.21)
|
|
103
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
104
|
+
railties (8.1.2)
|
|
105
|
+
actionpack (= 8.1.2)
|
|
106
|
+
activesupport (= 8.1.2)
|
|
107
|
+
irb (~> 1.13)
|
|
108
|
+
rackup (>= 1.0.0)
|
|
109
|
+
rake (>= 12.2)
|
|
110
|
+
thor (~> 1.0, >= 1.2.2)
|
|
111
|
+
tsort (>= 0.2)
|
|
112
|
+
zeitwerk (~> 2.6)
|
|
147
113
|
rainbow (3.1.1)
|
|
148
|
-
rake (13.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
114
|
+
rake (13.3.1)
|
|
115
|
+
rdoc (7.1.0)
|
|
116
|
+
erb
|
|
117
|
+
psych (>= 4.0.0)
|
|
118
|
+
tsort
|
|
119
|
+
regexp_parser (2.11.3)
|
|
120
|
+
reline (0.6.3)
|
|
121
|
+
io-console (~> 0.5)
|
|
122
|
+
rspec-core (3.13.6)
|
|
123
|
+
rspec-support (~> 3.13.0)
|
|
124
|
+
rspec-expectations (3.13.5)
|
|
154
125
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
155
|
-
rspec-support (~> 3.
|
|
156
|
-
rspec-mocks (3.
|
|
126
|
+
rspec-support (~> 3.13.0)
|
|
127
|
+
rspec-mocks (3.13.7)
|
|
157
128
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
158
|
-
rspec-support (~> 3.
|
|
159
|
-
rspec-rails (
|
|
160
|
-
actionpack (>=
|
|
161
|
-
activesupport (>=
|
|
162
|
-
railties (>=
|
|
163
|
-
rspec-core (~> 3.
|
|
164
|
-
rspec-expectations (~> 3.
|
|
165
|
-
rspec-mocks (~> 3.
|
|
166
|
-
rspec-support (~> 3.
|
|
167
|
-
rspec-support (3.
|
|
168
|
-
rubocop (1.
|
|
169
|
-
base64 (~> 0.1.1)
|
|
129
|
+
rspec-support (~> 3.13.0)
|
|
130
|
+
rspec-rails (8.0.2)
|
|
131
|
+
actionpack (>= 7.2)
|
|
132
|
+
activesupport (>= 7.2)
|
|
133
|
+
railties (>= 7.2)
|
|
134
|
+
rspec-core (~> 3.13)
|
|
135
|
+
rspec-expectations (~> 3.13)
|
|
136
|
+
rspec-mocks (~> 3.13)
|
|
137
|
+
rspec-support (~> 3.13)
|
|
138
|
+
rspec-support (3.13.6)
|
|
139
|
+
rubocop (1.82.1)
|
|
170
140
|
json (~> 2.3)
|
|
171
|
-
language_server-protocol (
|
|
141
|
+
language_server-protocol (~> 3.17.0.2)
|
|
142
|
+
lint_roller (~> 1.1.0)
|
|
172
143
|
parallel (~> 1.10)
|
|
173
|
-
parser (>= 3.
|
|
144
|
+
parser (>= 3.3.0.2)
|
|
174
145
|
rainbow (>= 2.2.2, < 4.0)
|
|
175
|
-
regexp_parser (>=
|
|
176
|
-
|
|
177
|
-
rubocop-ast (>= 1.28.1, < 2.0)
|
|
146
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
147
|
+
rubocop-ast (>= 1.48.0, < 2.0)
|
|
178
148
|
ruby-progressbar (~> 1.7)
|
|
179
|
-
unicode-display_width (>= 2.4.0, <
|
|
180
|
-
rubocop-ast (1.
|
|
181
|
-
parser (>= 3.
|
|
149
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
150
|
+
rubocop-ast (1.49.0)
|
|
151
|
+
parser (>= 3.3.7.2)
|
|
152
|
+
prism (~> 1.7)
|
|
182
153
|
ruby-progressbar (1.13.0)
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
activesupport (>= 5.2)
|
|
189
|
-
sprockets (>= 3.0.0)
|
|
190
|
-
thor (1.2.1)
|
|
191
|
-
timeout (0.4.1)
|
|
192
|
-
tzinfo (2.0.4)
|
|
154
|
+
securerandom (0.4.1)
|
|
155
|
+
stringio (3.2.0)
|
|
156
|
+
thor (1.5.0)
|
|
157
|
+
tsort (0.2.0)
|
|
158
|
+
tzinfo (2.0.6)
|
|
193
159
|
concurrent-ruby (~> 1.0)
|
|
194
|
-
unicode-display_width (2.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
160
|
+
unicode-display_width (3.2.0)
|
|
161
|
+
unicode-emoji (~> 4.1)
|
|
162
|
+
unicode-emoji (4.2.0)
|
|
163
|
+
uri (1.1.1)
|
|
164
|
+
useragent (0.16.11)
|
|
165
|
+
zeitwerk (2.7.4)
|
|
199
166
|
|
|
200
167
|
PLATFORMS
|
|
201
168
|
arm64-darwin-22
|
|
169
|
+
arm64-darwin-25
|
|
202
170
|
x86_64-darwin-20
|
|
171
|
+
x86_64-linux
|
|
203
172
|
|
|
204
173
|
DEPENDENCIES
|
|
205
|
-
activesupport (
|
|
206
|
-
diffy
|
|
207
|
-
rake (~> 13.
|
|
174
|
+
activesupport (>= 6.1.4.1)
|
|
175
|
+
diffy (~> 3.4)
|
|
176
|
+
rake (~> 13.2)
|
|
208
177
|
rspec-json_api!
|
|
209
|
-
rspec-rails (
|
|
210
|
-
rubocop
|
|
178
|
+
rspec-rails (>= 5.0.2)
|
|
179
|
+
rubocop (~> 1.65)
|
|
211
180
|
|
|
212
181
|
BUNDLED WITH
|
|
213
|
-
|
|
182
|
+
4.0.4
|
data/README.md
CHANGED
|
@@ -51,12 +51,12 @@ Generate new type:
|
|
|
51
51
|
RSpec.describe UsersController, type: :controller do
|
|
52
52
|
describe '#index' do
|
|
53
53
|
let(:expected_schema) do
|
|
54
|
-
|
|
54
|
+
[{
|
|
55
55
|
id: RSpec::JsonApi::Types::UUID,
|
|
56
56
|
name: String,
|
|
57
57
|
age: Integer,
|
|
58
|
-
|
|
59
|
-
number: -> { { type: Integer, min: 10, max: 20, lambda:
|
|
58
|
+
favoriteColorHex: /^\#([a-fA-F]|[0-9]){3,6}$/,
|
|
59
|
+
number: -> { { type: Integer, min: 10, max: 20, lambda: lambda(&:even?) } }
|
|
60
60
|
}]
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -150,7 +150,7 @@ The gem offers variety of possible matching methods.
|
|
|
150
150
|
|
|
151
151
|
Failure Example:
|
|
152
152
|
```ruby
|
|
153
|
-
let(:
|
|
153
|
+
let(:expected_schema) do
|
|
154
154
|
{
|
|
155
155
|
id: RSpec::JsonApi::Types::UUID,
|
|
156
156
|
name: String,
|
|
@@ -168,7 +168,7 @@ The gem offers variety of possible matching methods.
|
|
|
168
168
|
|
|
169
169
|
Success Example:
|
|
170
170
|
```ruby
|
|
171
|
-
let(:
|
|
171
|
+
let(:expected_schema) do
|
|
172
172
|
{
|
|
173
173
|
id: RSpec::JsonApi::Types::UUID,
|
|
174
174
|
name: String,
|
|
@@ -192,7 +192,7 @@ let(:expected_schema) do
|
|
|
192
192
|
id: "e0067346-4d24-4aa6-b303-f927a410a001",
|
|
193
193
|
name: "John",
|
|
194
194
|
age: 24,
|
|
195
|
-
|
|
195
|
+
favoriteColorHex: "#FF5733"
|
|
196
196
|
}
|
|
197
197
|
end
|
|
198
198
|
```
|
|
@@ -204,7 +204,7 @@ let(:expected_schema) do
|
|
|
204
204
|
id: Integer,
|
|
205
205
|
name: String,
|
|
206
206
|
age: Integer,
|
|
207
|
-
notes:
|
|
207
|
+
notes: [String]
|
|
208
208
|
}
|
|
209
209
|
end
|
|
210
210
|
```
|
|
@@ -231,12 +231,12 @@ end
|
|
|
231
231
|
### Interface match
|
|
232
232
|
```ruby
|
|
233
233
|
let(:expected_schema) do
|
|
234
|
-
|
|
234
|
+
[RSpec::JsonApi::Interfaces::PERSON]
|
|
235
235
|
end
|
|
236
236
|
```
|
|
237
237
|
|
|
238
238
|
### Proc match
|
|
239
|
-
Proc match allows to customize schema
|
|
239
|
+
Proc match allows to customize schema according needs using lambda shorthand notation `->`
|
|
240
240
|
|
|
241
241
|
Supported options:
|
|
242
242
|
- #### type
|
|
@@ -289,9 +289,9 @@ end
|
|
|
289
289
|
```
|
|
290
290
|
- #### lambda
|
|
291
291
|
```ruby
|
|
292
|
-
let(:
|
|
292
|
+
let(:expected_schema) do
|
|
293
293
|
{
|
|
294
|
-
number: -> { { lambda:
|
|
294
|
+
number: -> { { lambda: lambda(&:even?) } }
|
|
295
295
|
}
|
|
296
296
|
end
|
|
297
297
|
```
|