sinatra-swagger 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDNkNzU3NDI5MDI2YWFkZjQwMTU3NTQ4OTJiODgxZGJiZWRkMTQ5Mg==
4
+ MDU1MzAwYzE1OTIwMWRhYzllOGY5Mjg0NWM3MWRiNjJkNzI0ZGI0Nw==
5
5
  data.tar.gz: !binary |-
6
- YjgzOWE5YjkwNjcwMmQyMDk2ZTlhMDVkNTRiM2Y4OGFmYWE1MmI5OA==
6
+ ZjQ2MjM1NThmOTM0MDcyYTAxOTk5MGE5ZDcyYWEzYmNiZmZlNTEwYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTRiNWI5NjgxMmY1MGE0ZmFlMTFlYWY2YTE4YmFkY2RjOTU3ZDBkMDkwMGNl
10
- NjBmODJlNTM2M2VmMThkNjE3YjYwY2M3OTIwZDllMDc0YWViZGFlMjk2ODA1
11
- ODE1MjFjMzRiYjQwNTFiYzhiYWMyMzYxNTYwYmFmN2U2OGU2MWQ=
9
+ ZDQwZDY4ODAxZGMxZjg5NGNlMmNlOTU4MzVkNDkzNjRmNmIzNWM3NmY5Zjdj
10
+ NDZkZGYxZTFjZjQzMWJhMGI5MDk1MzRhMGM3ZGIxODY5ZjlkZWE1YzZhM2Y1
11
+ ZDY3ZTRlMmY3ZmIxNGM5NDk1ZmMwZGRlY2JkOTA4OTZhMjcyOTM=
12
12
  data.tar.gz: !binary |-
13
- YWQ4MWU4MjUxZGY5OWJlMDE0MmM3Y2E4MGVlYzE0MDczOGVlNjQ0YmMyNjEx
14
- ODAxYWFhOTRiYTEzODYxNjhlMTMxNzBiNjgxNWYzYmZjZGQ0Y2IzZGU2MDhk
15
- MWI5MGY1NDlhYjk1YjVmNDY2OGUyNTExMDE2YjJhMWE4ZmZhNTU=
13
+ OGM5ZWFmNjQxZTMyN2JlYmIzNGMxN2E1MzVmOTM3MDEyYzhmOThkNzVjY2Vj
14
+ ZWVhODU4OTJjMWZmNjMxNDQ4M2JjMDU4ODc3ZTFlNzNlMjk2ODUyZjJiM2Qz
15
+ YzkxZGVjZDg2OGE2ODQ3MjAyOTkwZjVhOTEwMjY3NWFiM2U2NWY=
data/README.md CHANGED
@@ -55,7 +55,20 @@ class Search < Sinatra::Base
55
55
  end
56
56
  ```
57
57
 
58
- For now, if you were to request `/search/books` (ie. no required 'q' param) or `/search/books?q=penumbra&limit=p` then a `before` hook would catch the error and return a `400` with a JSON description of the issue.
58
+ For now, if you were to request `/search/books?limit=p` then a `before` hook would catch the error and return a `400` with a JSON description of the issue.
59
+
60
+ ```json
61
+ {
62
+ "error": "invalid_params",
63
+ "developerMessage": "Some of the given parameters were invalid according to the Swagger spec.",
64
+ "details": {
65
+ "invalidities": {
66
+ "limit": "incorrect_type",
67
+ "q": "missing"
68
+ }
69
+ }
70
+ }
71
+ ```
59
72
 
60
73
  You can override what happens when an invalidity is encountered by overriding the helper method `invalid_params` which takes a hash of invalidities in the form `param_name => issue_description_as_symbol`.
61
74
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -14,7 +14,9 @@ module Sinatra
14
14
  {
15
15
  error: 'invalid_params',
16
16
  developerMessage: 'Some of the given parameters were invalid according to the Swagger spec.',
17
- invalidities: invalidities
17
+ details: {
18
+ invalidities: invalidities
19
+ }
18
20
  }.to_json
19
21
  )
20
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-swagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Hastings-Spital
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-14 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema