ms_rest 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -1
- data/lib/ms_rest/serialization.rb +11 -5
- data/lib/ms_rest/version.rb +1 -1
- data/ms_rest.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91bb8b8bc46f2a05daf7c0de84d0d94e010b43c2
|
4
|
+
data.tar.gz: 7fb413af783fc6ef7294538a78b7155d569eb3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5969cce618b705790f8ca50fca642fba7d0108fb88aea5ab6caa70f28dddc17662021c1c1165155a3da561f5d8d11e3581592375459388ad0ae1e5f62670c04e
|
7
|
+
data.tar.gz: 7507016e561db695d19c2695c6ca06164a3005efc5ae2e699b9eb21a5ea1183d6d2683b6709a51c1226536575000d7fd7bd2c1627ba35f7242f159915d0798c9
|
data/ChangeLog.md
CHANGED
@@ -1,2 +1,6 @@
|
|
1
|
+
##2016.07.21 ms_rest version 0.3.1
|
2
|
+
* [Bug fixes](https://github.com/Azure/autorest/commit/ede944a1fa30a7453aa30e6fa79154dc43393cdf)
|
3
|
+
|
1
4
|
##2016.07.14 ms_rest version 0.3.0
|
2
|
-
* Moving serialization/deserializaiton code from sdk models to client runtime. [#1106](https://github.com/Azure/autorest/pull/1106)
|
5
|
+
* Moving serialization/deserializaiton code from sdk models to client runtime. [#1106](https://github.com/Azure/autorest/pull/1106)
|
6
|
+
|
@@ -88,9 +88,9 @@ module MsRest
|
|
88
88
|
when 'String', 'Boolean', 'Object', 'Stream'
|
89
89
|
result = response_body
|
90
90
|
when 'Enum'
|
91
|
-
unless response_body.nil?
|
91
|
+
unless response_body.nil?
|
92
92
|
unless enum_is_valid(mapper, response_body)
|
93
|
-
warn "Enum
|
93
|
+
warn "Enum does not contain #{response_body}, but was received from the server."
|
94
94
|
end
|
95
95
|
end
|
96
96
|
result = response_body
|
@@ -146,6 +146,8 @@ module MsRest
|
|
146
146
|
parent_class = get_model(mapper[:type][:class_name])
|
147
147
|
discriminator = parent_class.class_eval("@@discriminatorMap")
|
148
148
|
model_name = response_body["#{mapper[:type][:polymorphic_discriminator]}"]
|
149
|
+
# In case we do not find model from response body then use the class defined in mapper
|
150
|
+
model_name = mapper[:type][:class_name] if model_name.nil? || model_name.empty?
|
149
151
|
model_class = get_model(discriminator[model_name])
|
150
152
|
else
|
151
153
|
model_class = get_model(mapper[:type][:class_name])
|
@@ -248,7 +250,7 @@ module MsRest
|
|
248
250
|
when 'Number', 'Double', 'String', 'Date', 'Boolean', 'Object', 'Stream'
|
249
251
|
payload = object != nil ? object : nil
|
250
252
|
when 'Enum'
|
251
|
-
unless object.nil?
|
253
|
+
unless object.nil?
|
252
254
|
unless enum_is_valid(mapper, object)
|
253
255
|
fail ValidationError, "Enum #{mapper[:type][:module]} does not contain #{object.to_s}, but trying to send it to the server."
|
254
256
|
end
|
@@ -392,8 +394,12 @@ module MsRest
|
|
392
394
|
# @param enum_value [String] Enum value to validate
|
393
395
|
#
|
394
396
|
def enum_is_valid(mapper, enum_value)
|
395
|
-
|
396
|
-
|
397
|
+
if enum_value.is_a?(String) && !enum_value.empty?
|
398
|
+
model = get_model(mapper[:type][:module])
|
399
|
+
model.constants.any? { |e| model.const_get(e).to_s.downcase == enum_value.downcase }
|
400
|
+
else
|
401
|
+
false
|
402
|
+
end
|
397
403
|
end
|
398
404
|
|
399
405
|
# Splits serialized_name with '.' to compute levels of object hierarchy
|
data/lib/ms_rest/version.rb
CHANGED
data/ms_rest.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.summary = %q{Azure Client Library for Ruby.}
|
16
16
|
spec.description = %q{Azure Client Library for Ruby.}
|
17
|
-
spec.homepage = 'https://
|
17
|
+
spec.homepage = 'https://github.com/Azure/autorest'
|
18
18
|
spec.license = 'MIT'
|
19
19
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ms_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,7 +138,7 @@ files:
|
|
138
138
|
- lib/ms_rest/validation_error.rb
|
139
139
|
- lib/ms_rest/version.rb
|
140
140
|
- ms_rest.gemspec
|
141
|
-
homepage: https://
|
141
|
+
homepage: https://github.com/Azure/autorest
|
142
142
|
licenses:
|
143
143
|
- MIT
|
144
144
|
metadata: {}
|