Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Making DataSpecifcation optional (TempFix)
Browse files Browse the repository at this point in the history
  • Loading branch information
juileetikekar committed Oct 27, 2023
1 parent 4dbfada commit f37ed41
Showing 1 changed file with 45 additions and 37 deletions.
82 changes: 45 additions & 37 deletions src/AasCore.Aas3_0/xmlization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16814,29 +16814,31 @@ out Reporting.Error? error
}
}

if (theDataSpecification == null)
{
error = new Reporting.Error(
"The required property DataSpecification has not been given " +
"in the XML representation of an instance of class EmbeddedDataSpecification");
return null;
}

if (theDataSpecificationContent == null)
{
error = new Reporting.Error(
"The required property DataSpecificationContent has not been given " +
"in the XML representation of an instance of class EmbeddedDataSpecification");
return null;
}

return new Aas.EmbeddedDataSpecification(
theDataSpecification
?? throw new System.InvalidOperationException(
"Unexpected null, had to be handled before"),
theDataSpecificationContent
?? throw new System.InvalidOperationException(
"Unexpected null, had to be handled before"));
//if (theDataSpecification == null)
//{
// error = new Reporting.Error(
// "The required property DataSpecification has not been given " +
// "in the XML representation of an instance of class EmbeddedDataSpecification");
// return null;
//}

//if (theDataSpecificationContent == null)
//{
// error = new Reporting.Error(
// "The required property DataSpecificationContent has not been given " +
// "in the XML representation of an instance of class EmbeddedDataSpecification");
// return null;
//}

//return new Aas.EmbeddedDataSpecification(
// theDataSpecification
// ?? throw new System.InvalidOperationException(
// "Unexpected null, had to be handled before"),
// theDataSpecificationContent
// ?? throw new System.InvalidOperationException(
// "Unexpected null, had to be handled before"));

return new EmbeddedDataSpecification(theDataSpecification, theDataSpecificationContent);
} // internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromSequence

/// <summary>
Expand Down Expand Up @@ -24897,25 +24899,31 @@ private void EmbeddedDataSpecificationToSequence(
Aas.IEmbeddedDataSpecification that,
Xml.XmlWriter writer)
{
writer.WriteStartElement(
"dataSpecification",
NS);
if (that.DataSpecification != null)
{
writer.WriteStartElement(
"dataSpecification",
NS);

this.ReferenceToSequence(
that.DataSpecification,
writer);
this.ReferenceToSequence(
that.DataSpecification,
writer);

writer.WriteEndElement();
writer.WriteEndElement();
}

writer.WriteStartElement(
"dataSpecificationContent",
NS);
if (that.DataSpecificationContent != null)
{
writer.WriteStartElement(
"dataSpecificationContent",
NS);

this.Visit(
that.DataSpecificationContent,
writer);
this.Visit(
that.DataSpecificationContent,
writer);

writer.WriteEndElement();
writer.WriteEndElement();
}

} // private void EmbeddedDataSpecificationToSequence

Expand Down

0 comments on commit f37ed41

Please sign in to comment.