webspicy 0.21.5 → 0.21.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebc6a59cdd54771817e5613d8a5ecf53651034453c801d3e505fc30d39851bed
|
4
|
+
data.tar.gz: e5ee25c0870072c02c69e6a90e2a6803de5dba78062b59b3bd8f1c183a7d91e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f8632e1117aa06d2b717b790f2150d35a305ee37f2de912f5b412decfe969d3a78f3470f9074a7eb35c6d2180adf9c3d0f02f6629628f7e07e4c18428378640
|
7
|
+
data.tar.gz: 9ef40e507cfb9e50de794dc1d9f593adf4e92f318aa1fd37a6ab4a13035c1977b308ae483e0d017838a6bb9143264b3d6f6dbe34dfdbfc1808ec0076c24d9490
|
data/lib/webspicy/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Webspicy
|
2
|
+
class Specification
|
3
|
+
module Pre
|
4
|
+
|
5
|
+
def contribute_to_openapi_verb(verb_defn)
|
6
|
+
verb_defn
|
7
|
+
end
|
8
|
+
|
9
|
+
end # module Pre
|
10
|
+
module Post
|
11
|
+
|
12
|
+
def contribute_to_openapi_verb(verb_defn)
|
13
|
+
verb_defn
|
14
|
+
end
|
15
|
+
|
16
|
+
end # module Post
|
17
|
+
end # class Specification
|
18
|
+
end # module Webspicy
|
@@ -100,6 +100,13 @@ module Webspicy
|
|
100
100
|
unless ['get', 'options', 'delete', 'head'].include?(verb)
|
101
101
|
verb_defn[:requestBody] = request_body_for(service)
|
102
102
|
end
|
103
|
+
verb_defn = service.conditions.inject(verb_defn) do |memo, p|
|
104
|
+
if p.respond_to?(:contribute_to_openapi_verb)
|
105
|
+
p.contribute_to_openapi_verb(memo)
|
106
|
+
else
|
107
|
+
memo
|
108
|
+
end
|
109
|
+
end
|
103
110
|
verbs.merge({ verb => verb_defn })
|
104
111
|
end
|
105
112
|
end
|
@@ -107,10 +114,15 @@ module Webspicy
|
|
107
114
|
def request_body_for(service)
|
108
115
|
schema = actual_input_schema(service)
|
109
116
|
example = nil # catch(:unfound) { generator.call(schema, {}) }
|
117
|
+
content_type = if service.method.downcase == 'post_form'
|
118
|
+
'application/x-www-form-urlencoded'
|
119
|
+
else
|
120
|
+
'application/json'
|
121
|
+
end
|
110
122
|
{
|
111
123
|
required: true,
|
112
124
|
content: {
|
113
|
-
|
125
|
+
content_type => {
|
114
126
|
schema: schema.to_json_schema,
|
115
127
|
example: example
|
116
128
|
}.compact
|
data/lib/webspicy/web/openapi.rb
CHANGED
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.
|
4
|
+
version: 0.21.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -351,6 +351,7 @@ files:
|
|
351
351
|
- lib/webspicy/web/mocker.rb
|
352
352
|
- lib/webspicy/web/mocker/config.ru
|
353
353
|
- lib/webspicy/web/openapi.rb
|
354
|
+
- lib/webspicy/web/openapi/ext.rb
|
354
355
|
- lib/webspicy/web/openapi/generator.rb
|
355
356
|
- lib/webspicy/web/specification.rb
|
356
357
|
- lib/webspicy/web/specification/file_upload.rb
|