fakeit 0.4.1 → 0.4.2

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: 6731f389644255b0fed1ba064f3ad16037de5936d305d0a7aafb711a5bf33bda
4
- data.tar.gz: 78070a872e99bce2b9cbe8e09d8ba179cc3bdd0c924e040293fdfa08dd944f2a
3
+ metadata.gz: fa4cb42c0187e460b3cbf72489ba5d0b7c8b3556a89a9ab770c4c263c271e633
4
+ data.tar.gz: f2285fe3eb42ac9e0b5f02130cab64794d2be425dd1f09a21b1334ba34f94125
5
5
  SHA512:
6
- metadata.gz: 4f2aa78fc96a37508d92728b3afcc00c465da0178566e6ac03eebaa248f077fff6607bfb5c18d771488acfaad1a74f7481de31b66112ba3dac7d68b3797d909b
7
- data.tar.gz: 1bc853eeddeaa9b5c045091f1ea490d9f4b5b3f479d1fb13f4b36ca7b287b05c8f54e58fbaf757934494fb1b8ffe076fb47e784ea5f4143c75bae5a843529d90
6
+ metadata.gz: '08c47760084910719518328975bcd2768428fc76a7cfe9da3a4a2075aebac66865b8a13e67344a19b3899a3598a0bf9a34aca8437ba860bba6a3f0dcc61ca868'
7
+ data.tar.gz: 8a29d3e962e7ecbd8f3cab02b480d01be9f279ae2f4d87194c3b58009dea2426e8acd5dd718e19a93215bfbff63a57569c11deecf0c2d0ffba614bb6e9470b85
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fakeit (0.4.1)
4
+ fakeit (0.4.2)
5
5
  faker (~> 2.2)
6
6
  openapi_parser (= 0.6.1)
7
7
  rack (~> 2.0)
@@ -37,7 +37,7 @@ module Fakeit
37
37
  def validate(operation, request)
38
38
  operation.validate(
39
39
  body: request.body&.read.to_s,
40
- params: request.params,
40
+ params: parse_query(request.query_string),
41
41
  headers: headers(request)
42
42
  )
43
43
  end
@@ -49,6 +49,15 @@ module Fakeit
49
49
  .map { |k, v| [k.sub(/^HTTP_/, '').split('_').map(&:capitalize).join('-'), v] }
50
50
  .to_h
51
51
  end
52
+
53
+ def parse_query(query_string)
54
+ rack_query = Rack::Utils.parse_nested_query(query_string)
55
+ cgi_query = CGI.parse(query_string)
56
+
57
+ rack_query.merge(cgi_query.slice(*rack_query.keys)) do |_, oldval, newval|
58
+ newval.is_a?(Array) && newval.size > 1 ? newval : oldval
59
+ end
60
+ end
52
61
  end
53
62
  end
54
63
  end
@@ -1,3 +1,3 @@
1
1
  module Fakeit
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakeit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Feng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2019-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler