json_skooma 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -2
- data/lib/json_skooma/keywords/validation/required.rb +13 -2
- data/lib/json_skooma/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 590937fba1ba290810ef51644d7f56126aee04b76ab7ded47b3f8175ccaa2eb5
|
4
|
+
data.tar.gz: 4c9c91d0ea350ad63dbec27730cbb66841e8aa54886d74ad492d7445dde3bd45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb845c9b702a338437a195ac5511b1a9abb18177a7ec7be314571f6a2c2f089495bc1449d9afd293babab77ef333c963dc1f8a49d4568f674a59e4bd8606bf23
|
7
|
+
data.tar.gz: 4f100d96e00e5e01cfdffe7d38192c19446f1ea901858139903a75598b1413ea5c0887b170fec16b52b1950139a1f006af0a527ec6aef6a96c91ec0b660aeddb
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning].
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.2.4] - 2024-10-31
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Improve error messages for missing required keys ([@alexkalderimis])
|
15
|
+
|
10
16
|
## [0.2.3] - 2024-04-28
|
11
17
|
|
12
18
|
### Fixed
|
@@ -47,10 +53,12 @@ and this project adheres to [Semantic Versioning].
|
|
47
53
|
|
48
54
|
- Initial implementation. ([@skryukov])
|
49
55
|
|
50
|
-
[@
|
56
|
+
[@alexkalderimis]: https://github.com/alexkalderimis
|
51
57
|
[@killondark]: https://github.com/killondark
|
58
|
+
[@skryukov]: https://github.com/skryukov
|
52
59
|
|
53
|
-
[Unreleased]: https://github.com/skryukov/json_skooma/compare/v0.2.
|
60
|
+
[Unreleased]: https://github.com/skryukov/json_skooma/compare/v0.2.4...HEAD
|
61
|
+
[0.2.4]: https://github.com/skryukov/json_skooma/compare/v0.2.3...v0.2.4
|
54
62
|
[0.2.3]: https://github.com/skryukov/json_skooma/compare/v0.2.2...v0.2.3
|
55
63
|
[0.2.2]: https://github.com/skryukov/json_skooma/compare/v0.2.1...v0.2.2
|
56
64
|
[0.2.1]: https://github.com/skryukov/json_skooma/compare/v0.2.0...v0.2.1
|
@@ -8,9 +8,20 @@ module JSONSkooma
|
|
8
8
|
self.instance_types = "object"
|
9
9
|
|
10
10
|
def evaluate(instance, result)
|
11
|
-
|
11
|
+
missing = required_keys.reject { |key| instance.key?(key) }
|
12
|
+
return if missing.none?
|
12
13
|
|
13
|
-
result.failure(
|
14
|
+
result.failure(missing_keys_message(missing))
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def required_keys
|
20
|
+
json.value
|
21
|
+
end
|
22
|
+
|
23
|
+
def missing_keys_message(missing)
|
24
|
+
"The object requires the following keys: #{required_keys.join(", ")}. Missing keys: #{missing.join(", ")}"
|
14
25
|
end
|
15
26
|
end
|
16
27
|
end
|
data/lib/json_skooma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_skooma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svyatoslav Kryukov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0'
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.5.
|
240
|
+
rubygems_version: 3.5.17
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: I bring some sugar for your JSONs.
|