Skip to content

Commit

Permalink
Use type names from interfaces for properties in implementing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Dec 6, 2017
1 parent d76ad43 commit ca8d542
Show file tree
Hide file tree
Showing 54 changed files with 45,124 additions and 19 deletions.
11 changes: 11 additions & 0 deletions XmlSchemaClassGenerator.Tests/XmlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ private Assembly Compile(string name, string pattern, Generator generatorPrototy
const string IS24ImmoTransferPattern = @"xsd\is24immotransfer\is24immotransfer.xsd";
const string WadlPattern = @"xsd\wadl\wadl.xsd";
const string ClientPattern = @"xsd\client\client.xsd";
const string IataPattern = @"xsd\iata\????[^_][^_]?[^-]*.xsd";

[Fact, TestPriority(1)]
[UseCulture("en-US")]
Expand All @@ -110,6 +111,16 @@ public void CanDeserializeSampleXml()
TestSamples("Wadl", WadlPattern);
Compile("IS24ImmoTransfer", IS24ImmoTransferPattern);
TestSamples("IS24ImmoTransfer", IS24ImmoTransferPattern);
Compile("Iata", IataPattern, new Generator
{
EntityFramework = true,
DataAnnotationMode = DataAnnotationMode.All,
NamespaceProvider = new Dictionary<NamespaceKey, string> { { new NamespaceKey(""), "XmlSchema" }, { new NamespaceKey("http://www.iata.org/IATA/EDIST/2017.2"), "Iata" } }
.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "Wadl" }.NamespaceProvider.GenerateNamespace),
MemberVisitor = (member, model) => { },
GenerateInterfaces = true
});
TestSamples("Iata", IataPattern);
}

private void TestSamples(string name, string pattern)
Expand Down
38 changes: 38 additions & 0 deletions XmlSchemaClassGenerator.Tests/xsd/iata/Acknowledgement.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iata.org/IATA/EDIST/2017.2" targetNamespace="http://www.iata.org/IATA/EDIST/2017.2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.000" id="IATA2017.2">
<xsd:include schemaLocation="edist_commontypes.xsd"/>
<!--
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
A C K N O W L E D G E M E N T R E S P O N S E B U S I N E S S O B J E C T
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<xsd:element name="Acknowledgement">
<xsd:annotation>
<xsd:documentation source="DESCRIPTION" xml:lang="en">The Acknowledgement document is a simple notification from party to party acknowledging the receipt of another transaction such as an inventory release or an updated order

It may also provide information indicating the status of the document.

This document is used consistently as an optional response to a notification transaction.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Document"/>
<xsd:element name="StatusCode" type="CodesetValueSimpleType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Status Code. Example: OK</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="StatusMessage" type="ShortDescSimpleType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Status Message.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attributeGroup ref="IATA_PayloadStdAttributes"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
123 changes: 123 additions & 0 deletions XmlSchemaClassGenerator.Tests/xsd/iata/AirDocDisplayRQ.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iata.org/IATA/EDIST/2017.2" targetNamespace="http://www.iata.org/IATA/EDIST/2017.2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="4.001" id="IATA2017.2">
<xsd:include schemaLocation="edist_commontypes.xsd"/>
<xsd:include schemaLocation="aidm_commontypes.xsd"/>
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
A I R D O C U M E N T D I S P L A Y R E Q U E S T B U S I N E S S O B J E C T
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<xsd:element name="AirDocDisplayRQ">
<xsd:annotation>
<xsd:documentation source="DESCRIPTION" xml:lang="en">The AirDocDisplay transaction set requests an Airline to return flight (ET) and/or ancillary (EMD) document details.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="PointOfSale" minOccurs="0"/>
<xsd:element ref="Document"/>
<xsd:element ref="Party"/>
<xsd:element name="Query">
<xsd:annotation>
<xsd:documentation>Air Document Display Request Query.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DisplayCriteria" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Used to specify they types of documents to display when requested by other than the ticket/document number.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="ET_OnlyInd" type="xsd:boolean" use="optional">
<xsd:annotation>
<xsd:documentation>If true, only display electronic tickets.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="EMD_OnlyInd" type="xsd:boolean" use="optional">
<xsd:annotation>
<xsd:documentation>When true, only display EMDs.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="Flight" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Flight information for which a ticket/document is requested.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="AirlineID"/>
<xsd:element ref="FlightNumber"/>
<xsd:element ref="DepartureDate"/>
<xsd:element ref="DepartureCode"/>
<xsd:element ref="ArrivalCode"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="TicketDocument" type="TicketDocumentType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>The ticket/document number to be displayed.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="OrderID" type="CouponOrderKeyType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The order id for which a ticket/document is requested.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="FQTV" type="TravelerFQTV_Type" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The frequent flier information for which a ticket/document is requested.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="FOID" type="TravelerFOID_Type" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Passenger check in information for which a ticket/document is requested.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="BookingReferences" minOccurs="0"/>
<xsd:element name="DataLists" minOccurs="0">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="description" xml:lang="en">Common NDC Data List choices.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="PassengerList" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Passenger data list definition.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Passenger" type="PassengerType" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Any person except members of the crew carried or to be carried with the consent of the carrier, on board of any transport vehicle such as aircraft, train, bus, ship.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ContactList" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Contact data list definition.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ContactInformation" type="ContactInformationType" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>The electronic or geographic address which a party has provided as the contact channel. For example, contact email, contact postal address, contact phone number.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attributeGroup ref="IATA_PayloadStdAttributes"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Loading

0 comments on commit ca8d542

Please sign in to comment.