webspicy 0.21.5 → 0.21.6

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: 1a55b29fa6f9f5f48358b4a050582679f7e32816b82ea818c3f8d07ee1f6e166
4
- data.tar.gz: 045b1c9ea0127645ddfd8bb14a7b464daa1c9a309d0796d31898800f7629637e
3
+ metadata.gz: dd39249e2d93a03a088b344c149394e112e57e8b34f5fb20ae2d48018a7c48c5
4
+ data.tar.gz: 73cbf44b32c9f8609106ddac8495e94d590d3d827325ca40ce7d7d483b35767d
5
5
  SHA512:
6
- metadata.gz: d8d6e028b67558796b58b9a24ec27e0594b33160613838e211557a75e924447acafe9c75ead65a2d91cc4c62b55b714b8c45a9af1af3ad3d30f1ad80a379fce6
7
- data.tar.gz: 251d467be2ec28bf4dd9f6026b71dae998290911bb613a53a540c888e2287ae7b9d81c57e947f35c451c7c975b096709692c44dddc1534204895dcc24613dca5
6
+ metadata.gz: bddeb1dc84bcbe261f037df5051e575d2540eb781538bc240b736b33b15b7d6876362ffcce456510a9fa90e8b2574952c73006bec8e670a5cc737f625402b843
7
+ data.tar.gz: 8e0c0275a2b14909491ca835e002fb33869f0d44617605339869a1275ccaf5457b1e1cda356106cd23ef4bd4d73c595bac151d551cf9144bfb363062eb49ca5d
@@ -29,6 +29,10 @@ module Webspicy
29
29
  @raw[:description]
30
30
  end
31
31
 
32
+ def conditions
33
+ preconditions + postconditions
34
+ end
35
+
32
36
  def preconditions
33
37
  @preconditions ||= compile_preconditions
34
38
  end
@@ -2,7 +2,7 @@ module Webspicy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 21
5
- TINY = 5
5
+ TINY = 6
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -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
@@ -1 +1,2 @@
1
1
  require_relative 'openapi/generator'
2
+ require_relative 'openapi/ext'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.5
4
+ version: 0.21.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
@@ -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