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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9ea82724f82c4030a6844a7bad0eec6abe406c1dbdb7d75697431f7273cafd4
4
- data.tar.gz: 704c05fc995113d8aeacf92d86c55d0d6acb4d034ac0f98016bca627ed9b0156
3
+ metadata.gz: 95a7fdafc540b448187281dfcd184257553fc79cbf93af6236463e9bbcadcfa5
4
+ data.tar.gz: a5710b3e26d6fb8078d1079359f78dbe0b7a12810411f86652a84997086a0022
5
5
  SHA512:
6
- metadata.gz: 73c06f4654242606bd99af1b1f75f8feb3cf6cea6973513cc54d5ad6e7d62cf0e2ea783e62b1676c8c9e33adbf95c0bd3062c1df9aa79cd84a2618f95de8c342
7
- data.tar.gz: eedad48faafdac8442419d1890e06632e0d92fac7d7946714d9dea9cad0ab30e5917f119ec7393858ad73e70bfc169ea18d9cd3e633356a0c39e9513c8154249
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.0...HEAD
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
@@ -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(@model_name, value, e.message)
43
- rescue Dry::Types::CoercionError => e
44
- raise RestEasy::ConstraintError.new(@model_name, value, e.message)
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RestEasy
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
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.0
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-19 00:00:00.000000000 Z
13
+ date: 2026-05-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dry-types