api_schema 0.1.9 → 0.1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5e4d0f360e78c52fc2876685815f71f420e78a0
4
- data.tar.gz: 0d811c03472a4cedf981e76fdf3b6511801ca12d
3
+ metadata.gz: 175bb9264dcf923158ad05b31808e0699700cb7b
4
+ data.tar.gz: 5b5b6d436295f1addfcdb2186fc2341a5b5d14ca
5
5
  SHA512:
6
- metadata.gz: 3b1187935430ca023c1e6f6545f128a83be15055a32c954aa0b4ee0506b9db08089bed25049a416c671579c9ff620f2dffa6c79db483a893db2f74920b724060
7
- data.tar.gz: caa99920b6115cc4abcbd76bd32cf0c68e51596105c09cd160da636d7542fdad465b18950b09f71497a008f61474740d719a160d4cc882e922aa78ec0eb936d6
6
+ metadata.gz: f33a130676995f9d8d81d0c3c2cb1ac5bdd37155dbbdb5d5b1f18b9a7cbc64b8f6c4659334c667a310a1028904a3a6b115748fad7a52f732b48becbba211724b
7
+ data.tar.gz: 49d29e82afd8cd701acdc12d9cae5917197999c7e8f3b04402055f19c3634435e5c3e3546c7ba35a1ebaff3ec55fe1b6282fb202308ebc8a7f0f80fee97b6e16
@@ -10,6 +10,7 @@ module ApiSchema
10
10
  @header_params = []
11
11
  @path_params = []
12
12
  @query_params = []
13
+ @errors = []
13
14
  end
14
15
 
15
16
  HeaderParam = ::Struct.new(:name, :type, :required)
@@ -67,6 +68,11 @@ module ApiSchema
67
68
  !!body_param
68
69
  end
69
70
 
71
+ def body_defined?
72
+ return true if api_version.serializers.detect {|s| s.id == body_param }
73
+ raise "There is no '#{body_param}' body parameter defined for #{full_path} resource. Please define it with 'request_body' method"
74
+ end
75
+
70
76
  def with_errors?
71
77
  !errors.empty?
72
78
  end
@@ -1,3 +1,3 @@
1
1
  module ApiSchema
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Chopey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport