schematic 0.0.6 → 0.0.7
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.
@@ -112,7 +112,8 @@ module Schematic
|
|
112
112
|
additional_methods.each do |method_name, values|
|
113
113
|
method_xsd_name = method_name.to_s.dasherize
|
114
114
|
if values.present?
|
115
|
-
|
115
|
+
max_occurrences = values.is_a?(Hash) ? {} : {"maxOccurs" => "1"}
|
116
|
+
builder.xs :element, {"name" => method_xsd_name, "minOccurs" => "0"}.merge(max_occurrences) do |element|
|
116
117
|
element.xs :complexType do |complex_type|
|
117
118
|
complex_type.xs :all do |nested_all|
|
118
119
|
if values.is_a?(Array)
|
data/lib/schematic/version.rb
CHANGED
@@ -58,7 +58,7 @@ describe Schematic::Serializers::Xsd do
|
|
58
58
|
|
59
59
|
class << self
|
60
60
|
def xsd_methods
|
61
|
-
{:foo => { :bar => { :baz => nil } } }
|
61
|
+
{:foo => { :bar => { :baz => nil }, :quz => [:qaz] } }
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -240,10 +240,6 @@ describe Schematic::Serializers::Xsd do
|
|
240
240
|
end
|
241
241
|
end
|
242
242
|
|
243
|
-
describe "nested attributes" do
|
244
|
-
|
245
|
-
end
|
246
|
-
|
247
243
|
end
|
248
244
|
|
249
245
|
context "with a model with validations" do
|
@@ -446,10 +442,10 @@ describe Schematic::Serializers::Xsd do
|
|
446
442
|
</xs:simpleContent>
|
447
443
|
</xs:complexType>
|
448
444
|
</xs:element>
|
449
|
-
<xs:element name="foo" minOccurs="0"
|
445
|
+
<xs:element name="foo" minOccurs="0">
|
450
446
|
<xs:complexType>
|
451
447
|
<xs:all>
|
452
|
-
<xs:element name="bar" minOccurs="0"
|
448
|
+
<xs:element name="bar" minOccurs="0">
|
453
449
|
<xs:complexType>
|
454
450
|
<xs:all>
|
455
451
|
<xs:element name="baz" minOccurs="0" maxOccurs="1"/>
|