request_handler 2.1.0 → 2.1.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: 7fb382a3a9c578b69efee4f3f24371d3f1539cb9695057130ec60f04c7be858e
4
- data.tar.gz: b5b4e80acb25c29c8e2cf1f139b9ec902750a0f46b0ac31311d9d144272f24f0
3
+ metadata.gz: f859646a0aa398cdae621ee5fa65dfc141041f2d7459130e43c6dd187f33cd34
4
+ data.tar.gz: 58ac3fcdfdace2cef4810ff885cf9f43b98902c37a84aea56489359df14741ed
5
5
  SHA512:
6
- metadata.gz: 9ff65ee31333500b115f8b15e3f60561740e647f9c6171d51516aa7c8db0f369b85c7af44fe61b47ebab77888d74d7fec8e774c04cbd3833c2204e7565af28cb
7
- data.tar.gz: b30401b3c56285040c493e5c4c8e80165ed6e1226d6d058906cf93b1ddf4a6226164325a6931ec73e81a42e8463d2a288689a41ee94e71f0af71b671154ec4ec
6
+ metadata.gz: 246011e015199ccabf514606819ee30ff53784e658f756fb891c3dba75b8af20a962910c4251401a9b770f194c06a089c15f2f10e1eadd78061128bba8c49872
7
+ data.tar.gz: ab07fa30b9095bcc7dbc41cd5fe948e80fa84d55252fb9b02b6a8ea656324f4c597d7e469b6d70b976b66a08f013f66feb71fbe141208deb71bc82a491292502
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [2.1.1] - 2021-06-14
10
+ ### Fixed
11
+ - Change error object's source attribute from `param` to `parameters` to align with JSONAPI specification
12
+
7
13
  ## [2.1.0] - 2020-04-01
8
14
  ### Added
9
15
  - Headers validation
data/README.md CHANGED
@@ -82,7 +82,7 @@ the abstract class `RequestHandler::Validation::Engine`
82
82
  To set up a handler, you need create a class which inherits from
83
83
  `RequestHandler::Base`, providing at least the options block and a `to_dto`
84
84
  method with the parts you want to use. To use it, create a new instance of the
85
- handler passing in the request, after that you can use the handler.dto method to
85
+ handler passing in the request, after that you can use the handler.to_dto method to
86
86
  process and access the data. Here is a short example, check
87
87
  `spec/integration/request_handler_spec.rb` for a detailed one.
88
88
 
@@ -249,7 +249,7 @@ class CreateQuestionHandler < RequestHandler::Base
249
249
  end
250
250
  ```
251
251
 
252
- Assuming that the request consists of a json file `question.json` containing
252
+ Assuming that the request consists of a json file `question.json` containing
253
253
  ``` json
254
254
  {
255
255
  "id": "1",
@@ -472,6 +472,8 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/runtas
472
472
  This project is intended to be a safe, welcoming space for collaboration, and
473
473
  contributors are expected to adhere to the [code of conduct][cc].
474
474
 
475
+ Check out our [career page](https://www.runtastic.com/career/) if you'd like to work with us.
476
+
475
477
  ## License
476
478
  The gem is available as open source under [the terms of the MIT License][mit].
477
479
 
@@ -46,7 +46,7 @@ module RequestHandler
46
46
  raise FieldsetsParamsError, [{ code: 'INVALID_QUERY_PARAMETER',
47
47
  status: '400',
48
48
  detail: "allowed fieldset does not include '#{option}'",
49
- source: { param: "fields[#{type}]" } }]
49
+ source: { parameter: "fields[#{type}]" } }]
50
50
  end
51
51
 
52
52
  def check_required_fieldsets_types(fieldsets)
@@ -62,7 +62,7 @@ module RequestHandler
62
62
  code: 'INVALID_QUERY_PARAMETER',
63
63
  status: '400',
64
64
  detail: "fieldset for '#{type}' not allowed",
65
- source: { param: "fields[#{type}]" }
65
+ source: { parameter: "fields[#{type}]" }
66
66
  }
67
67
  ]
68
68
  end
@@ -77,7 +77,7 @@ module RequestHandler
77
77
  {
78
78
  code: 'MISSING_QUERY_PARAMETER',
79
79
  status: '400',
80
- source: { param: '' },
80
+ source: { parameter: '' },
81
81
  detail: "missing required parameter fields[#{type}]"
82
82
  }
83
83
  end
@@ -37,7 +37,7 @@ module RequestHandler
37
37
  {
38
38
  status: '400',
39
39
  code: 'INVALID_QUERY_PARAMETER',
40
- source: { param: source_param }
40
+ source: { parameter: source_param }
41
41
  }
42
42
  end
43
43
 
@@ -35,7 +35,7 @@ module RequestHandler
35
35
  status: '400',
36
36
  code: code,
37
37
  detail: detail,
38
- source: { param: 'include' }
38
+ source: { parameter: 'include' }
39
39
  }
40
40
  ]
41
41
  end
@@ -79,7 +79,7 @@ module RequestHandler
79
79
  code: 'INVALID_QUERY_PARAMETER',
80
80
  status: '400',
81
81
  detail: 'must be a positive integer',
82
- source: { param: "page[#{param}]" }
82
+ source: { parameter: "page[#{param}]" }
83
83
  }]
84
84
  end
85
85
 
@@ -20,7 +20,7 @@ module RequestHandler
20
20
  { status: '400',
21
21
  code: "#{query[param] ? 'INVALID' : 'MISSING'}_QUERY_PARAMETER",
22
22
  detail: schema_error[:detail],
23
- source: { param: param } }
23
+ source: { parameter: param } }
24
24
  end)
25
25
  end
26
26
 
@@ -51,7 +51,7 @@ module RequestHandler
51
51
  {
52
52
  code: 'INVALID_QUERY_PARAMETER',
53
53
  status: '400',
54
- source: { param: 'sort' },
54
+ source: { parameter: 'sort' },
55
55
  detail: detail
56
56
  }
57
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RequestHandler
4
- VERSION = '2.1.0'.freeze
4
+ VERSION = '2.1.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request_handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Eger
8
8
  - Dominik Goltermann
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-04-01 00:00:00.000000000 Z
12
+ date: 2021-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: docile
@@ -319,7 +319,7 @@ homepage: https://github.com/runtastic/request_handler
319
319
  licenses:
320
320
  - MIT
321
321
  metadata: {}
322
- post_install_message:
322
+ post_install_message:
323
323
  rdoc_options: []
324
324
  require_paths:
325
325
  - lib
@@ -334,8 +334,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubygems_version: 3.0.3
338
- signing_key:
337
+ rubygems_version: 3.1.2
338
+ signing_key:
339
339
  specification_version: 4
340
340
  summary: shared base for request_handler using dry-* gems
341
341
  test_files: []