rescue_registry 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 237133f9678393d12439ef50317b1671632606d3d35a7b5f658cf4eab3083bbc
4
- data.tar.gz: ffac90b369e7b345fd74de72db7178f420b9577ca30e26d1b8427cf2e58049e4
3
+ metadata.gz: a1680176387616a079a616679ca436f7e1a81ff266c1a6d8d574caa71e6ccab7
4
+ data.tar.gz: 329c59744d4fc5eddb2a1d91fc3049df660966a54b13625b667e4085b59daeb8
5
5
  SHA512:
6
- metadata.gz: 43d1e9755b0333d69646594e28e6caef2219e02b9a18d466fd8bee0b204d4fefdc817628d958899abe8e6391327a5a9f131889ea0ee44ac611e778d5a1f3d70c
7
- data.tar.gz: 54dcad7d3ad63eec2dd5c752cafff76ff248832093603f45e1c0c959e10b8e62dcc9102e1823a163b5c6452022ab6fc3f2ed8ac5267cbcc52290916092329b6f
6
+ metadata.gz: f174ee373dc0352d366bb4e4ad6deedd95185600e904db85fe472622765e0726e6c07678de7f28c002cf5e39279725bc3400f5db105acb81254a20acb0945acb
7
+ data.tar.gz: a3f82a0a1b907baf038cb274a0fb8d7fbb4198e49dc9f5d6b49aee417b782c22dedd03cb17bf8d314f6507f6faf40cb7dc0928871d1a44d3af81f9692b9305e2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.3.0] - 2021-05-11
11
+ ### Changed
12
+ - For better JSONAPI spec compliance, errors payloads will not include the `details` key when value is `null`.
13
+ - Error payloads will not include the `meta` key when value is an empty object.
14
+
10
15
  ## [0.2.5] - 2021-03-09
11
16
  ### Added
12
17
  - `code` can now be provided as an argument to `register_exception` - #29 (thanks @amaierhofer)
@@ -75,14 +75,20 @@ module RescueRegistry
75
75
  )
76
76
  end
77
77
 
78
+ error_payload = {
79
+ code: error_code,
80
+ status: status_code.to_s,
81
+ title: title
82
+ }
83
+
84
+ if (d = detail)
85
+ error_payload[:detail] = d
86
+ end
87
+
88
+ error_payload[:meta] = payload_meta if payload_meta.any?
89
+
78
90
  {
79
- errors: [
80
- code: error_code,
81
- status: status_code.to_s,
82
- title: title,
83
- detail: detail,
84
- meta: payload_meta
85
- ]
91
+ errors: [error_payload]
86
92
  }
87
93
  end
88
94
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RescueRegistry
4
- VERSION = "0.2.5"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rescue_registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Wagenet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.2.3
135
+ rubygems_version: 3.2.15
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Registry for Rails Exceptions