webspicy 0.21.0 → 0.21.3

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: 297aab67c7235a6a0100db0b857b15d7897beeaa58aa8a8572b4b13df5ccba28
4
- data.tar.gz: a5694c1b122ed3c135790b04e837d88be9baad28c2b5b8cb594311339dc89c34
3
+ metadata.gz: adc3c1464cb9c8972496a11fedda7a0dfda39e34ba82c5ad60a71ccc574d712c
4
+ data.tar.gz: 892220efe2eadc8e1b62ea7e97039814de451f8949b5a89030cca027b3b4c383
5
5
  SHA512:
6
- metadata.gz: 6c68dfdb65de4636f3cbc85703f6224e7ff7bcf9edd77cdf92aa67de47fd7086ceb2b1c4b91317a944f0acd618c03c8caa9c3f2c5e76f004b4e0fe779adc7085
7
- data.tar.gz: 994aa8228e557a3baef8612653dc5d6d30377b2c405eb6f35508acd0c953865d23bd2da0f73be5492ea70c538fdb9ba2ef3fcc4f0f1253e7b6ee9cce2ea8e35a
6
+ metadata.gz: 74243ff6d5c32357fa04da777ec9eede39a703405c8297abc7246b9f023dd1a34ed38c6ca6564326265fc9b59c46ae227ea0698de19c3256ffca2dc50d3a0ff0
7
+ data.tar.gz: 79ed95fa65038bfff561c1956f728de2cfa57f705bc6d7b73bf8ba541d53f30056fc99eb231c28a1a91a5c61e8ca9b2b0ad8eaf1c5d5b482f9178068c97472ad
@@ -60,7 +60,7 @@ module Webspicy
60
60
  abort("KO") unless reporter.find(Reporter::SuccessOrNot).success?
61
61
  end
62
62
 
63
- def find_and_call(method, url, mutation)
63
+ def find_and_call(method, url, mutation, config = self.config)
64
64
  unless tc = scope.find_test_case(method, url)
65
65
  raise Error, "No such service `#{method} #{url}`"
66
66
  end
@@ -2,7 +2,7 @@ module Webspicy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 21
5
- TINY = 0
5
+ TINY = 3
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -55,8 +55,8 @@ module Webspicy
55
55
  def options(url, params = {}, headers = nil, body = nil)
56
56
  info_request("OPTIONS", url, params, headers, body)
57
57
 
58
- params = querystring_params(params)
59
- http_opts = http_options(params: params)
58
+ url = url + "?" + Rack::Utils.build_query(params) if !params.empty?
59
+ http_opts = http_options
60
60
  @last_response = HTTP[headers || {}].options(url, http_opts)
61
61
 
62
62
  debug_response(@last_response)
@@ -67,8 +67,8 @@ module Webspicy
67
67
  def get(url, params = {}, headers = nil, body = nil)
68
68
  info_request("GET", url, params, headers, body)
69
69
 
70
- params = querystring_params(params)
71
- http_opts = http_options(params: params)
70
+ url = url + "?" + Rack::Utils.build_query(params) if !params.empty?
71
+ http_opts = http_options
72
72
  @last_response = HTTP[headers || {}].get(url, http_opts)
73
73
 
74
74
  debug_response(@last_response)
@@ -111,6 +111,7 @@ module Webspicy
111
111
  def patch(url, params = {}, headers = nil, body = nil)
112
112
  info_request("PATCH", url, params, headers, body)
113
113
 
114
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
114
115
  headers ||= {}
115
116
  headers['Content-Type'] ||= 'application/json'
116
117
  http_opts = http_options(body: params.to_json)
@@ -124,6 +125,7 @@ module Webspicy
124
125
  def put(url, params = {}, headers = nil, body = nil)
125
126
  info_request("PUT", url, params, headers, body)
126
127
 
128
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
127
129
  headers ||= {}
128
130
  headers['Content-Type'] ||= 'application/json'
129
131
  http_opts = http_options(body: params.to_json)
@@ -137,6 +139,7 @@ module Webspicy
137
139
  def post_form(url, params = {}, headers = nil, body = nil)
138
140
  info_request("POST", url, params, headers, body)
139
141
 
142
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
140
143
  http_opts = http_options(form: params)
141
144
  @last_response = HTTP[headers || {}].post(url, http_opts)
142
145
 
@@ -148,6 +151,7 @@ module Webspicy
148
151
  def delete(url, params = {}, headers = nil, body = nil)
149
152
  info_request("DELETE", url, params, headers, body)
150
153
 
154
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
151
155
  http_opts = http_options(body: params.to_json)
152
156
  @last_response = HTTP[headers || {}].delete(url, http_opts)
153
157
 
@@ -156,7 +160,7 @@ module Webspicy
156
160
  @last_response
157
161
  end
158
162
 
159
- def http_options(extra)
163
+ def http_options(extra = {})
160
164
  if config.insecure
161
165
  ctx = OpenSSL::SSL::SSLContext.new
162
166
  ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
@@ -7,7 +7,9 @@ module Webspicy
7
7
 
8
8
  def initialize(config)
9
9
  @config = Configuration.dress(config)
10
- @generator = config.generator || Finitio::Generation.new
10
+ @generator = config.generator || Finitio::Generation.new(
11
+ collection_size: 1..1
12
+ )
11
13
  end
12
14
  attr_reader :config, :generator
13
15
 
@@ -37,7 +39,7 @@ module Webspicy
37
39
  def path_for(specification)
38
40
  {
39
41
  standardize(specification.url) => {
40
- summary: specification.name
42
+ summary: specification.name.to_s || 'API Specification'
41
43
  }.merge(verbs_for(specification))
42
44
  }
43
45
  end
@@ -49,7 +51,7 @@ module Webspicy
49
51
 
50
52
  def verbs_for(specification)
51
53
  specification.services.inject({}) do |verbs,service|
52
- verb = service.method.downcase
54
+ verb = service.method.downcase.gsub(/_form$/, '')
53
55
  verb_defn = {
54
56
  description: service.description,
55
57
  parameters: parameters_for(service),
@@ -18,7 +18,8 @@ module Webspicy
18
18
  def locate(specification)
19
19
  FileUpload.new({
20
20
  path: specification.locate(path),
21
- content_type: content_type
21
+ content_type: content_type,
22
+ param_name: param_name
22
23
  })
23
24
  end
24
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-21 00:00:00.000000000 Z
11
+ date: 2022-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake