d4h_api 2.1.1 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0779daf3ee6c5a7b4b2f9531c983e9ec41f821707fee870d07e2e3eb548bf6aa'
4
- data.tar.gz: c9c6d0035b99b5f17ebcd79e82c9dec3636708a96bf54716c3b060e184126a34
3
+ metadata.gz: 3b61a4f54b1269b7c89ec9575be26669fc431e8d4c70cb5ade3c35f4d621f77a
4
+ data.tar.gz: 59a7a03c6c6ae5f5cd21e2cefecfa6ada0db1b4d0471684b08d06c4df49ff09d
5
5
  SHA512:
6
- metadata.gz: d5188ff94ece93bf10e1c1a15bc6c82c67c640ae17bbeca9fbbe2216ae153a529d72b7f9bb9503eff2717c44240b28b692c5b792bf2e8295f700f5cbdfcb593d
7
- data.tar.gz: f7ce5ed22080c3188267a18523b52c5b24bf4473ae3fefdfe5f8ea5eb6c1c7420647f26d624093a46fa6499bc9443a7b4b15911142c925bef78822c1d15ae412
6
+ metadata.gz: 0d5006a8ed5c1d103527c574a20dff9c0bbddab86ccc9a681c4565185a91afca8ded0743d5737a1ca43d494eb0f198aa568949d5af721034c4477568d101a4d2
7
+ data.tar.gz: c0f26f4892cdf6705ff35bcde75c91954ff462bbdd07074db563b8761126390a8de732a5b9b66e499abea2588ff9fab2d8245047b83e59ac5c23294fe741aef9
checksums.yaml.gz.sig CHANGED
Binary file
@@ -106,7 +106,7 @@ module D4H
106
106
 
107
107
  # Public: Returns the memoized Faraday connection.
108
108
  #
109
- # Configured with URL-encoded request encoding, JSON response parsing,
109
+ # Configured with JSON request encoding, JSON response parsing,
110
110
  # exponential backoff retry on transient errors, and the chosen adapter.
111
111
  #
112
112
  # The retry middleware retries on 429 and 5xx status codes up to
@@ -116,7 +116,7 @@ module D4H
116
116
  def connection
117
117
  @connection ||= Faraday.new do |f|
118
118
  f.url_prefix = base_url
119
- f.request(:url_encoded)
119
+ f.request(:json)
120
120
  if max_retries > 0
121
121
  f.request(:retry,
122
122
  max: max_retries,
@@ -128,7 +128,11 @@ module D4H
128
128
  return response if (200..299).cover?(response.status)
129
129
 
130
130
  body = response.body || {}
131
- message = [body["title"], body["detail"], body["error"], body["message"]].compact.uniq.join(": ")
131
+ parts = [body["title"], body["detail"], body["error"], body["message"]].compact.uniq
132
+ if (issues = body.dig("detailObj", "data", "issues"))
133
+ issues.each { |issue| parts << "#{issue["path"]&.join(".")}: #{issue["message"]}" }
134
+ end
135
+ message = parts.join(": ")
132
136
 
133
137
  raise RetriableError, message if Client::RETRIABLE_STATUSES.include?(response.status)
134
138
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module D4H
4
4
  module API
5
- VERSION = "2.1.1"
5
+ VERSION = "2.2.0"
6
6
  end
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d4h_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Osiczko
metadata.gz.sig CHANGED
Binary file