rest-easy 1.3.0 → 1.3.1
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/CHANGELOG.md +15 -1
- data/lib/rest_easy/attribute.rb +6 -4
- data/lib/rest_easy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 95a7fdafc540b448187281dfcd184257553fc79cbf93af6236463e9bbcadcfa5
|
|
4
|
+
data.tar.gz: a5710b3e26d6fb8078d1079359f78dbe0b7a12810411f86652a84997086a0022
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7444dc20090fc6547e1f55516fcb0a9d7d467ecfd6f0a9530c768ae7d6b735fa2ca789bdb7cc222277269fa4494a05c4187b2f3ffd28c74d82636ae09a197848
|
|
7
|
+
data.tar.gz: 1c7af7dc5042410d6a11483356c41a24dacff39c240fb1cdce1950b859f47c2adb4a6293f93e0257ef5e5b482fb28b000d3660c6f2c705fe9b1925a3837e3837
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [1.3.1] - 2026-05-27
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **`ConstraintError` messages now include the attribute name.**
|
|
10
|
+
When attribute coercion fails, the raised `RestEasy::ConstraintError`
|
|
11
|
+
previously surfaced only the underlying dry-types reason
|
|
12
|
+
(e.g. `invalid value for Integer(): ""`), leaving the user to guess which
|
|
13
|
+
attribute on which resource had failed. The message now prefixes the
|
|
14
|
+
model-side attribute name:
|
|
15
|
+
`Attribute 'count': invalid value for Integer(): ""`.
|
|
16
|
+
The exception's `#attribute_name` reader is unchanged.
|
|
17
|
+
|
|
5
18
|
## [1.3.0] - 2026-05-19
|
|
6
19
|
|
|
7
20
|
### Added
|
|
@@ -69,7 +82,8 @@
|
|
|
69
82
|
|
|
70
83
|
Initial release.
|
|
71
84
|
|
|
72
|
-
[Unreleased]: https://github.com/accodeing/rest-easy/compare/v1.3.
|
|
85
|
+
[Unreleased]: https://github.com/accodeing/rest-easy/compare/v1.3.1...HEAD
|
|
86
|
+
[1.3.1]: https://github.com/accodeing/rest-easy/compare/v1.3.0...v1.3.1
|
|
73
87
|
[1.3.0]: https://github.com/accodeing/rest-easy/compare/v1.2.0...v1.3.0
|
|
74
88
|
[1.2.0]: https://github.com/accodeing/rest-easy/compare/v1.1.2...v1.2.0
|
|
75
89
|
[1.1.2]: https://github.com/accodeing/rest-easy/compare/v1.1.1...v1.1.2
|
data/lib/rest_easy/attribute.rb
CHANGED
|
@@ -38,10 +38,12 @@ module RestEasy
|
|
|
38
38
|
|
|
39
39
|
def coerce(value)
|
|
40
40
|
@type[value]
|
|
41
|
-
rescue Dry::Types::ConstraintError => e
|
|
42
|
-
raise RestEasy::ConstraintError.new(
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
rescue Dry::Types::ConstraintError, Dry::Types::CoercionError => e
|
|
42
|
+
raise RestEasy::ConstraintError.new(
|
|
43
|
+
@model_name,
|
|
44
|
+
value,
|
|
45
|
+
"Attribute '#{@model_name}': #{e.message}"
|
|
46
|
+
)
|
|
45
47
|
end
|
|
46
48
|
|
|
47
49
|
def parse_value(*raw_values)
|
data/lib/rest_easy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rest-easy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonas Schubert Erlandsson
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2026-05-
|
|
13
|
+
date: 2026-05-27 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: dry-types
|