Skip to content

Commit

Permalink
feat: Prevent classes with ambiguous choices
Browse files Browse the repository at this point in the history
  • Loading branch information
tefra committed Mar 2, 2024
1 parent 8de2eda commit 3beda15
Show file tree
Hide file tree
Showing 471 changed files with 67,702 additions and 81,287 deletions.
16 changes: 10 additions & 6 deletions output/instances/boeingData/ipo1/ipo_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

obj = PurchaseOrder(
ship_to_or_bill_to_or_single_address=[
Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.AL,
zip=90952
DerivedElement(
qname='shipTo',
value=Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.AL,
zip=90952
),
type='{http://www.example.com/IPO}USAddress'
),
DerivedElement(
qname='billTo',
Expand Down
16 changes: 10 additions & 6 deletions output/instances/boeingData/ipo2/ipo_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

obj = PurchaseOrder(
ship_to_or_bill_to_or_single_address=[
Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
DerivedElement(
qname='shipTo',
value=Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
),
type='{http://www.example.com/add}USAddress'
),
DerivedElement(
qname='billTo',
Expand Down
16 changes: 10 additions & 6 deletions output/instances/boeingData/ipo3/ipo_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

obj = PurchaseOrder(
ship_to_or_bill_to_or_single_address=[
Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
DerivedElement(
qname='{http://www.example.com/IPO}shipTo',
value=Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
),
type='{http://www.example.com/add}USAddress'
),
DerivedElement(
qname='{http://www.example.com/IPO}billTo',
Expand Down
18 changes: 11 additions & 7 deletions output/instances/boeingData/ipo4/ipo_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@

obj = PurchaseOrder(
ship_to_or_bill_to_or_single_address=[
Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
country='United States of America',
state=Usstate.CA,
zip=90952
DerivedElement(
qname='{http://www.example.com/IPO}shipTo',
value=Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
country='United States of America',
state=Usstate.CA,
zip=90952
),
type='{http://www.example.com/IPO}USAddress'
),
DerivedElement(
qname='{http://www.example.com/IPO}billTo',
Expand Down
16 changes: 10 additions & 6 deletions output/instances/boeingData/ipo5/ipo_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

obj = PurchaseOrder(
ship_to_or_bill_to_or_single_address=[
Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
DerivedElement(
qname='{http://www.example.com/IPO}shipTo',
value=Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
),
type='{http://www.example.com/IPO}USAddress'
),
DerivedElement(
qname='{http://www.example.com/IPO}billTo',
Expand Down
16 changes: 10 additions & 6 deletions output/instances/boeingData/ipo6/ipo_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
value='Ms.'
),
ship_to_or_bill_to_or_single_address=[
Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
DerivedElement(
qname='{http://www.example.com/IPO}shipTo',
value=Usaddress(
name='Alice Smith',
street='123 Maple Street',
city='Mill Valley',
state=Usstate.CA,
zip=90952
),
type='{http://www.example.com/IPO}USAddress'
),
DerivedElement(
qname='{http://www.example.com/IPO}billTo',
Expand Down
8 changes: 4 additions & 4 deletions output/instances/ibmData/mixed/assertions/po_sample/po.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import LongItemDefn
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import Poitems
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import ShortItemDefn
from xsdata.formats.dataclass.models.generics import DerivedElement


obj = Order(
buyer=Buyer(
choice=[
'Jimmy',
DerivedElement(
qname='lName',
Buyer.FName(
value='Jimmy'
),
Buyer.LName(
value='Nice'
),
]
Expand Down
5 changes: 2 additions & 3 deletions output/instances/ibmData/valid/D3_4_6/d3_4_6v06.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from output.models.ibm_data.valid.d3_4_6.d3_4_6v06_xsd.d3_4_6v06 import Nametest
from output.models.ibm_data.valid.d3_4_6.d3_4_6v06_xsd.d3_4_6v06 import Root
from xsdata.formats.dataclass.models.generics import DerivedElement


obj = Root(
choice=[
DerivedElement(
qname='{a}_-',
Nametest.TypeType(
value='_-'
),
]
Expand Down
7 changes: 5 additions & 2 deletions output/instances/ibmMeta/defaultAttributesApply.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from output.models.common.xsts_xsd.xsts import KnownToken
from output.models.common.xsts_xsd.xsts import Prior
from output.models.common.xsts_xsd.xsts import SchemaDocument
from output.models.common.xsts_xsd.xsts import SchemaDocumentRefRole
from output.models.common.xsts_xsd.xsts import SchemaTest
from output.models.common.xsts_xsd.xsts import Status
from output.models.common.xsts_xsd.xsts import TestGroup
Expand Down Expand Up @@ -680,7 +681,8 @@
href='../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii08.xsd'
),
SchemaDocument(
href='../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii08b.xsd'
href='../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii08b.xsd',
role=SchemaDocumentRefRole.OVERRIDDEN
),
],
expected=[
Expand Down Expand Up @@ -804,7 +806,8 @@
href='../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii10.xsd'
),
SchemaDocument(
href='../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii10b.xsd'
href='../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii10b.xsd',
role=SchemaDocumentRefRole.OVERRIDDEN
),
],
expected=[
Expand Down
4 changes: 2 additions & 2 deletions output/instances/ibmMeta/defaultAttributesApply.testSet
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<ts:documentationReference xlink:type="locator" xlink:href="../common/XSD1_1TestCategories.xml#xsd1_1-DefaultAttributeGroup-Override"/>
<ts:schemaTest name="s3_4_2_4ii08s">
<ts:schemaDocument xlink:type="locator" xlink:href="../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii08.xsd"/>
<ts:schemaDocument xlink:type="locator" xlink:href="../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii08b.xsd"/>
<ts:schemaDocument xlink:type="locator" xlink:href="../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii08b.xsd" role="overridden"/>
<ts:expected validity="valid"/>
<ts:current status="accepted" date="2010-12-01"/>
</ts:schemaTest>
Expand Down Expand Up @@ -229,7 +229,7 @@
<ts:documentationReference xlink:type="locator" xlink:href="../common/XSD1_1TestCategories.xml#xsd1_1-DefaultAttributeGroup-Override"/>
<ts:schemaTest name="s3_4_2_4ii10s">
<ts:schemaDocument xlink:type="locator" xlink:href="../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii10.xsd"/>
<ts:schemaDocument xlink:type="locator" xlink:href="../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii10b.xsd"/>
<ts:schemaDocument xlink:type="locator" xlink:href="../ibmData/instance_invalid/S3_4_2_4/s3_4_2_4ii10b.xsd" role="overridden"/>
<ts:expected validity="valid"/>
<ts:current status="accepted" date="2010-12-01"/>
</ts:schemaTest>
Expand Down
2 changes: 1 addition & 1 deletion output/instances/ibmMeta/edcWildcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
appinfo_or_documentation=[
Documentation(
content=[
'\n Changed the status to "invalid" in response to bug #12130\n ',
'\n Changed the status to "invalid" in response to bug #12130.\n Note: (MHK 2023-07-30) The test has a probably unintended feature:\n the xsi:schemaLocation in the instance document pairs a namespace URI\n "a" with a schema document whose target namespace is actually "b".\n It seems this is not an error according to the spec.\n ',
]
),
]
Expand Down
6 changes: 5 additions & 1 deletion output/instances/ibmMeta/edcWildcard.testSet
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
<ts:current status="accepted" date="2011-07-29">
<ts:annotation>
<ts:documentation>
Changed the status to "invalid" in response to bug #12130
Changed the status to "invalid" in response to bug #12130.
Note: (MHK 2023-07-30) The test has a probably unintended feature:
the xsi:schemaLocation in the instance document pairs a namespace URI
"a" with a schema document whose target namespace is actually "b".
It seems this is not an error according to the spec.
</ts:documentation>
</ts:annotation>
</ts:current>
Expand Down
11 changes: 4 additions & 7 deletions output/instances/msData/additional/addB088.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from output.models.ms_data.additional.add_b088_xsd.add_b088 import Doc
from output.models.ms_data.additional.add_b088_xsd.add_b088_imp import Any1
from output.models.ms_data.additional.add_b088_xsd.add_b088_imp import Doc1
from xsdata.formats.dataclass.models.generics import AnyElement


obj = Doc(
Expand All @@ -11,17 +10,15 @@
target_namespace_imported_xsd_element=Doc1(
elem1=[
Any1(
local_element_or_bbb_or_ccc=AnyElement(
qname='{http://importedXSD}bbb',
text=''
local_element_or_bbb_or_ccc=Any1.Bbb(

)
),
],
elem2=[
Any1(
local_element_or_bbb_or_ccc=AnyElement(
qname='{http://importedXSD}bbb',
text=''
local_element_or_bbb_or_ccc=Any1.Bbb(

)
),
]
Expand Down
5 changes: 2 additions & 3 deletions output/instances/msData/additional/addB090.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
text=''
),
],
c1_or_c2=AnyElement(
qname='c1',
text=''
c1_or_c2=Doc.C1(

)
)
Loading

0 comments on commit 3beda15

Please sign in to comment.