From d4c5ee1b49e3f9249b8956f1b072509368e77a71 Mon Sep 17 00:00:00 2001 From: samatrhea Date: Fri, 1 Sep 2023 17:38:55 +0200 Subject: [PATCH] [Refactor] reference serializer to be inline with KERML spec; fixes #29 --- .../AutoGenSerializer/ElementSerializer.cs | 3 ++ .../TriggerInvocationExpressionSerializer.cs | 38 +++++++++---------- .../SysML2.NET.CodeGenerator.csproj | 4 +- .../core-json-dto-serializer-template.hbs | 21 ++++++++-- .../AcceptActionUsageSerializer.cs | 6 +++ .../ActionDefinitionSerializer.cs | 6 +++ .../ActionUsageSerializer.cs | 6 +++ .../ActorMembershipSerializer.cs | 27 +++++++++++++ .../AllocationDefinitionSerializer.cs | 18 +++++++++ .../AllocationUsageSerializer.cs | 18 +++++++++ .../AnalysisCaseDefinitionSerializer.cs | 6 +++ .../AnalysisCaseUsageSerializer.cs | 6 +++ .../AnnotatingElementSerializer.cs | 9 +++++ .../AutoGenSerializer/AnnotationSerializer.cs | 24 ++++++++++++ .../AssertConstraintUsageSerializer.cs | 6 +++ .../AssignmentActionUsageSerializer.cs | 6 +++ .../AssociationSerializer.cs | 18 +++++++++ .../AssociationStructureSerializer.cs | 18 +++++++++ .../AttributeDefinitionSerializer.cs | 6 +++ .../AttributeUsageSerializer.cs | 6 +++ .../AutoGenSerializer/BehaviorSerializer.cs | 6 +++ .../BindingConnectorAsUsageSerializer.cs | 18 +++++++++ .../BindingConnectorSerializer.cs | 18 +++++++++ .../BooleanExpressionSerializer.cs | 6 +++ .../CalculationDefinitionSerializer.cs | 6 +++ .../CalculationUsageSerializer.cs | 6 +++ .../CaseDefinitionSerializer.cs | 6 +++ .../AutoGenSerializer/CaseUsageSerializer.cs | 6 +++ .../Core/AutoGenSerializer/ClassSerializer.cs | 6 +++ .../AutoGenSerializer/ClassifierSerializer.cs | 6 +++ .../CollectExpressionSerializer.cs | 6 +++ .../AutoGenSerializer/CommentSerializer.cs | 9 +++++ .../ConcernDefinitionSerializer.cs | 6 +++ .../ConcernUsageSerializer.cs | 6 +++ .../ConjugatedPortDefinitionSerializer.cs | 6 +++ .../ConjugatedPortTypingSerializer.cs | 33 ++++++++++++++++ .../ConjugationSerializer.cs | 24 ++++++++++++ .../ConnectionDefinitionSerializer.cs | 18 +++++++++ .../ConnectionUsageSerializer.cs | 18 +++++++++ .../AutoGenSerializer/ConnectorSerializer.cs | 18 +++++++++ .../ConstraintDefinitionSerializer.cs | 6 +++ .../ConstraintUsageSerializer.cs | 6 +++ .../AutoGenSerializer/DataTypeSerializer.cs | 6 +++ .../DecisionNodeSerializer.cs | 6 +++ .../AutoGenSerializer/DefinitionSerializer.cs | 6 +++ .../AutoGenSerializer/DependencySerializer.cs | 24 ++++++++++++ .../DifferencingSerializer.cs | 21 ++++++++++ .../AutoGenSerializer/DisjoiningSerializer.cs | 24 ++++++++++++ .../DocumentationSerializer.cs | 9 +++++ .../ElementFilterMembershipSerializer.cs | 21 ++++++++++ .../EndFeatureMembershipSerializer.cs | 27 +++++++++++++ .../EnumerationDefinitionSerializer.cs | 6 +++ .../EnumerationUsageSerializer.cs | 6 +++ .../EventOccurrenceUsageSerializer.cs | 6 +++ .../ExhibitStateUsageSerializer.cs | 6 +++ .../AutoGenSerializer/ExpressionSerializer.cs | 6 +++ .../FeatureChainExpressionSerializer.cs | 6 +++ .../FeatureChainingSerializer.cs | 21 ++++++++++ .../FeatureInvertingSerializer.cs | 24 ++++++++++++ .../FeatureMembershipSerializer.cs | 27 +++++++++++++ .../FeatureReferenceExpressionSerializer.cs | 6 +++ .../AutoGenSerializer/FeatureSerializer.cs | 6 +++ .../FeatureTypingSerializer.cs | 30 +++++++++++++++ .../FeatureValueSerializer.cs | 21 ++++++++++ .../FlowConnectionDefinitionSerializer.cs | 18 +++++++++ .../FlowConnectionUsageSerializer.cs | 18 +++++++++ .../ForLoopActionUsageSerializer.cs | 6 +++ .../AutoGenSerializer/ForkNodeSerializer.cs | 6 +++ .../FramedConcernMembershipSerializer.cs | 27 +++++++++++++ .../AutoGenSerializer/FunctionSerializer.cs | 6 +++ .../IfActionUsageSerializer.cs | 6 +++ .../IncludeUseCaseUsageSerializer.cs | 6 +++ .../InteractionSerializer.cs | 18 +++++++++ .../InterfaceDefinitionSerializer.cs | 18 +++++++++ .../InterfaceUsageSerializer.cs | 18 +++++++++ .../IntersectingSerializer.cs | 21 ++++++++++ .../AutoGenSerializer/InvariantSerializer.cs | 6 +++ .../InvocationExpressionSerializer.cs | 6 +++ .../ItemDefinitionSerializer.cs | 6 +++ .../ItemFeatureSerializer.cs | 6 +++ .../ItemFlowEndSerializer.cs | 6 +++ .../AutoGenSerializer/ItemFlowSerializer.cs | 18 +++++++++ .../AutoGenSerializer/ItemUsageSerializer.cs | 6 +++ .../AutoGenSerializer/JoinNodeSerializer.cs | 6 +++ .../LibraryPackageSerializer.cs | 6 +++ .../AutoGenSerializer/LifeClassSerializer.cs | 6 +++ .../LiteralBooleanSerializer.cs | 6 +++ .../LiteralExpressionSerializer.cs | 6 +++ .../LiteralInfinitySerializer.cs | 6 +++ .../LiteralIntegerSerializer.cs | 6 +++ .../LiteralRationalSerializer.cs | 6 +++ .../LiteralStringSerializer.cs | 6 +++ .../MembershipExposeSerializer.cs | 21 ++++++++++ .../MembershipImportSerializer.cs | 21 ++++++++++ .../AutoGenSerializer/MembershipSerializer.cs | 21 ++++++++++ .../AutoGenSerializer/MergeNodeSerializer.cs | 6 +++ .../AutoGenSerializer/MetaclassSerializer.cs | 6 +++ .../MetadataAccessExpressionSerializer.cs | 9 +++++ .../MetadataDefinitionSerializer.cs | 6 +++ .../MetadataFeatureSerializer.cs | 9 +++++ .../MetadataUsageSerializer.cs | 9 +++++ .../MultiplicityRangeSerializer.cs | 6 +++ .../MultiplicitySerializer.cs | 6 +++ .../NamespaceExposeSerializer.cs | 21 ++++++++++ .../NamespaceImportSerializer.cs | 21 ++++++++++ .../AutoGenSerializer/NamespaceSerializer.cs | 6 +++ .../NullExpressionSerializer.cs | 6 +++ .../ObjectiveMembershipSerializer.cs | 27 +++++++++++++ .../OccurrenceDefinitionSerializer.cs | 6 +++ .../OccurrenceUsageSerializer.cs | 6 +++ .../OperatorExpressionSerializer.cs | 6 +++ .../OwningMembershipSerializer.cs | 21 ++++++++++ .../AutoGenSerializer/PackageSerializer.cs | 6 +++ .../ParameterMembershipSerializer.cs | 27 +++++++++++++ .../PartDefinitionSerializer.cs | 6 +++ .../AutoGenSerializer/PartUsageSerializer.cs | 6 +++ .../PerformActionUsageSerializer.cs | 6 +++ .../PortConjugationSerializer.cs | 27 +++++++++++++ .../PortDefinitionSerializer.cs | 6 +++ .../AutoGenSerializer/PortUsageSerializer.cs | 6 +++ .../AutoGenSerializer/PredicateSerializer.cs | 6 +++ .../RedefinitionSerializer.cs | 36 ++++++++++++++++++ .../ReferenceSubsettingSerializer.cs | 33 ++++++++++++++++ .../ReferenceUsageSerializer.cs | 6 +++ .../RenderingDefinitionSerializer.cs | 6 +++ .../RenderingUsageSerializer.cs | 6 +++ ...quirementConstraintMembershipSerializer.cs | 27 +++++++++++++ .../RequirementDefinitionSerializer.cs | 6 +++ .../RequirementUsageSerializer.cs | 6 +++ ...irementVerificationMembershipSerializer.cs | 27 +++++++++++++ .../ResultExpressionMembershipSerializer.cs | 27 +++++++++++++ .../ReturnParameterMembershipSerializer.cs | 27 +++++++++++++ .../SatisfyRequirementUsageSerializer.cs | 6 +++ .../SelectExpressionSerializer.cs | 6 +++ .../SendActionUsageSerializer.cs | 6 +++ .../SpecializationSerializer.cs | 24 ++++++++++++ .../StakeholderMembershipSerializer.cs | 27 +++++++++++++ .../StateDefinitionSerializer.cs | 6 +++ .../StateSubactionMembershipSerializer.cs | 27 +++++++++++++ .../AutoGenSerializer/StateUsageSerializer.cs | 6 +++ .../Core/AutoGenSerializer/StepSerializer.cs | 6 +++ .../AutoGenSerializer/StructureSerializer.cs | 6 +++ .../SubclassificationSerializer.cs | 30 +++++++++++++++ .../SubjectMembershipSerializer.cs | 27 +++++++++++++ .../AutoGenSerializer/SubsettingSerializer.cs | 30 +++++++++++++++ .../SuccessionAsUsageSerializer.cs | 18 +++++++++ ...SuccessionFlowConnectionUsageSerializer.cs | 18 +++++++++ .../SuccessionItemFlowSerializer.cs | 18 +++++++++ .../AutoGenSerializer/SuccessionSerializer.cs | 18 +++++++++ .../TextualRepresentationSerializer.cs | 9 +++++ .../TransitionFeatureMembershipSerializer.cs | 27 +++++++++++++ .../TransitionUsageSerializer.cs | 6 +++ .../TriggerInvocationExpressionSerializer.cs | 6 +++ .../TypeFeaturingSerializer.cs | 30 +++++++++++++++ .../Core/AutoGenSerializer/TypeSerializer.cs | 6 +++ .../AutoGenSerializer/UnioningSerializer.cs | 21 ++++++++++ .../Core/AutoGenSerializer/UsageSerializer.cs | 6 +++ .../UseCaseDefinitionSerializer.cs | 6 +++ .../UseCaseUsageSerializer.cs | 6 +++ .../VariantMembershipSerializer.cs | 21 ++++++++++ .../VerificationCaseDefinitionSerializer.cs | 6 +++ .../VerificationCaseUsageSerializer.cs | 6 +++ .../ViewDefinitionSerializer.cs | 6 +++ .../ViewRenderingMembershipSerializer.cs | 27 +++++++++++++ .../AutoGenSerializer/ViewUsageSerializer.cs | 6 +++ .../ViewpointDefinitionSerializer.cs | 6 +++ .../ViewpointUsageSerializer.cs | 6 +++ .../WhileLoopActionUsageSerializer.cs | 6 +++ .../PIM/ProjectDeSerializer.cs | 10 ++++- .../SysML2.NET.Serializer.Json.csproj | 4 +- 170 files changed, 2105 insertions(+), 27 deletions(-) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/ElementSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/ElementSerializer.cs index 782938a1..5401a996 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/ElementSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/ElementSerializer.cs @@ -72,7 +72,10 @@ public static void Serialize(IElement iElement, Utf8JsonWriter writer, Serializa writer.WriteStartArray("ownedRelationship"); foreach (var item in iElement.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs index 2ed5995b..2f7c20af 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs @@ -50,16 +50,16 @@ public static void Serialize(ITriggerInvocationExpression iTriggerInvocationExpr { writer.WriteStartObject(); - writer.WritePropertyName("@id"); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTriggerInvocationExpression.Id); - writer.WritePropertyName("@type"); + writer.WritePropertyName("@type"u8); writer.WriteStringValue("TriggerInvocationExpression"); - writer.WritePropertyName("kind"); + writer.WritePropertyName("kind"u8); writer.WriteStringValue(iTriggerInvocationExpression.Kind.ToString().ToUpper()); - writer.WritePropertyName("direction"); + writer.WritePropertyName("direction"u8); if (iTriggerInvocationExpression.Direction.HasValue) { writer.WriteStringValue(iTriggerInvocationExpression.Direction.Value.ToString().ToUpper()); @@ -69,54 +69,54 @@ public static void Serialize(ITriggerInvocationExpression iTriggerInvocationExpr writer.WriteNullValue(); } - writer.WritePropertyName("isComposite"); + writer.WritePropertyName("isComposite"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsComposite); - writer.WritePropertyName("isDerived"); + writer.WritePropertyName("isDerived"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsDerived); - writer.WritePropertyName("isEnd"); + writer.WritePropertyName("isEnd"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsEnd); - writer.WritePropertyName("isOrdered"); + writer.WritePropertyName("isOrdered"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsOrdered); - writer.WritePropertyName("isPortion"); + writer.WritePropertyName("isPortion"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsPortion); - writer.WritePropertyName("isReadOnly"); + writer.WritePropertyName("isReadOnly"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsReadOnly); - writer.WritePropertyName("isUnique"); + writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsUnique); - writer.WritePropertyName("isAbstract"); + writer.WritePropertyName("isAbstract"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsAbstract); - writer.WritePropertyName("isSufficient"); + writer.WritePropertyName("isSufficient"u8); writer.WriteBooleanValue(iTriggerInvocationExpression.IsSufficient); - writer.WriteStartArray("aliasIds"); + writer.WriteStartArray("aliasIds"u8); foreach (var item in iTriggerInvocationExpression.AliasIds) { writer.WriteStringValue(item); } writer.WriteEndArray(); - writer.WritePropertyName("elementId"); + writer.WritePropertyName("elementId"u8); writer.WriteStringValue(iTriggerInvocationExpression.ElementId); - writer.WritePropertyName("name"); + writer.WritePropertyName("name"u8); writer.WriteStringValue(iTriggerInvocationExpression.Name); - writer.WriteStartArray("ownedRelationship"); + writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iTriggerInvocationExpression.OwnedRelationship) { writer.WriteStringValue(item); } writer.WriteEndArray(); - writer.WritePropertyName("owningRelationship"); + writer.WritePropertyName("owningRelationship"u8); if (iTriggerInvocationExpression.OwningRelationship.HasValue) { writer.WriteStringValue(iTriggerInvocationExpression.OwningRelationship.Value); @@ -126,7 +126,7 @@ public static void Serialize(ITriggerInvocationExpression iTriggerInvocationExpr writer.WriteNullValue(); } - writer.WritePropertyName("shortName"); + writer.WritePropertyName("shortName"u8); writer.WriteStringValue(iTriggerInvocationExpression.ShortName); writer.WriteEndObject(); diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index cbe45d88..4738134e 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/SysML2.NET.CodeGenerator/Templates/core-json-dto-serializer-template.hbs b/SysML2.NET.CodeGenerator/Templates/core-json-dto-serializer-template.hbs index af2988af..723af691 100644 --- a/SysML2.NET.CodeGenerator/Templates/core-json-dto-serializer-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/core-json-dto-serializer-template.hbs @@ -72,7 +72,12 @@ namespace SysML2.NET.Serializer.Json.Core.DTO writer.WriteStartArray("{{String.LowerCaseFirstLetter structuralFeature.Name }}"u8); foreach (var item in i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name}}) { - {{#if (StructuralFeature.QueryIsBool structuralFeature )}} + {{#if (structuralFeature.QueryIsReference structuralFeature)}} + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); + writer.WriteStringValue(item); + writer.WriteEndObject(); + {{else if (StructuralFeature.QueryIsBool structuralFeature )}} writer.WriteBooleanValue(item); {{else if (StructuralFeature.QueryIsNumeric structuralFeature )}} writer.WriteNumberValue(item); @@ -91,7 +96,12 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{ else }} if (i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}.HasValue) { - {{#if (StructuralFeature.QueryIsBool structuralFeature )}} + {{#if (structuralFeature.QueryIsReference structuralFeature)}} + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); + writer.WriteStringValue(i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}.Value); + writer.WriteEndObject(); + {{else if (StructuralFeature.QueryIsBool structuralFeature )}} writer.WriteBooleanValue(i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}.Value); {{else if (StructuralFeature.QueryIsNumeric structuralFeature )}} writer.WriteNumberValue(i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}.Value); @@ -108,7 +118,12 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{/if}} {{ else if (StructuralFeature.QueryIsScalar structuralFeature)}} writer.WritePropertyName("{{ String.LowerCaseFirstLetter structuralFeature.Name }}"u8); - {{#if (StructuralFeature.QueryIsBool structuralFeature )}} + {{#if (structuralFeature.QueryIsReference structuralFeature)}} + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); + writer.WriteStringValue(i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}); + writer.WriteEndObject(); + {{else if (StructuralFeature.QueryIsBool structuralFeature )}} writer.WriteBooleanValue(i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}); {{else if (StructuralFeature.QueryIsString structuralFeature )}} writer.WriteStringValue(i{{EClass.Name}}.{{String.CapitalizeFirstLetter structuralFeature.Name }}); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs index ab3f7565..5bfc57d6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAcceptActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAcceptActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAcceptActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionDefinitionSerializer.cs index 43093648..ee802af0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iActionDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iActionDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActionDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs index 9a1f570d..de872191 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs index 9308a7a1..3c728052 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iActorMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActorMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iActorMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iActorMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActorMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iActorMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iActorMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iActorMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iActorMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActorMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iActorMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActorMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iActorMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iActorMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iActorMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iActorMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs index 3b5f2f88..14a92c79 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs @@ -99,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iAllocationDefinition.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAllocationDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iAllocationDefinition.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAllocationDefinition.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -122,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iAllocationDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAllocationDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -131,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iAllocationDefinition.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iAllocationDefinition.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs index a641ee22..89aad0f2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs @@ -132,21 +132,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iAllocationUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAllocationUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iAllocationUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAllocationUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -155,7 +164,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iAllocationUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAllocationUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -173,14 +185,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iAllocationUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iAllocationUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseDefinitionSerializer.cs index 694789b6..4bf160e1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAnalysisCaseDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAnalysisCaseDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnalysisCaseDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs index 2933b48d..69d3f9ee 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAnalysisCaseUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAnalysisCaseUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnalysisCaseUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotatingElementSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotatingElementSerializer.cs index 5a3b6e78..d45a374c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotatingElementSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotatingElementSerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("annotation"u8); foreach (var item in iAnnotatingElement.Annotation) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -91,14 +94,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAnnotatingElement.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAnnotatingElement.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnnotatingElement.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs index ac18e9fe..4a31fdf0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs @@ -72,10 +72,16 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteEndArray(); writer.WritePropertyName("annotatedElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnnotation.AnnotatedElement); + writer.WriteEndObject(); writer.WritePropertyName("annotatingElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnnotation.AnnotatingElement); + writer.WriteEndObject(); writer.WritePropertyName("declaredName"u8); writer.WriteStringValue(iAnnotation.DeclaredName); @@ -93,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iAnnotation.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAnnotation.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iAnnotation.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnnotation.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iAnnotation.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAnnotation.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iAnnotation.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iAnnotation.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs index 84326f19..f31058e7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs @@ -129,14 +129,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAssertConstraintUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAssertConstraintUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAssertConstraintUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs index b3201838..246b3c86 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAssignmentActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAssignmentActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAssignmentActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs index df363d77..0c254b52 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs @@ -93,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iAssociation.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAssociation.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iAssociation.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAssociation.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iAssociation.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAssociation.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,14 +137,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iAssociation.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iAssociation.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs index 90e9d31f..1aff4cab 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs @@ -93,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iAssociationStructure.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAssociationStructure.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iAssociationStructure.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAssociationStructure.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iAssociationStructure.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAssociationStructure.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,14 +137,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iAssociationStructure.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iAssociationStructure.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeDefinitionSerializer.cs index 948348ab..0cce9912 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeDefinitionSerializer.cs @@ -93,14 +93,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAttributeDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAttributeDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAttributeDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs index 6917328e..e6b9a86e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iAttributeUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iAttributeUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iAttributeUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BehaviorSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BehaviorSerializer.cs index ff3eed86..2bfcb77f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BehaviorSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BehaviorSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iBehavior.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iBehavior.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iBehavior.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs index 48e46ab4..9bd29641 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs @@ -129,21 +129,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iBindingConnectorAsUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iBindingConnectorAsUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iBindingConnectorAsUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iBindingConnectorAsUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -152,7 +161,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iBindingConnectorAsUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iBindingConnectorAsUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -161,14 +173,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iBindingConnectorAsUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iBindingConnectorAsUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs index ea06b7eb..d8c5954c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs @@ -126,21 +126,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iBindingConnector.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iBindingConnector.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iBindingConnector.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iBindingConnector.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -149,7 +158,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iBindingConnector.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iBindingConnector.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -158,14 +170,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iBindingConnector.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iBindingConnector.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BooleanExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BooleanExpressionSerializer.cs index 0a0fceeb..9c8abec2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BooleanExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BooleanExpressionSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iBooleanExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iBooleanExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iBooleanExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationDefinitionSerializer.cs index 0a68aff6..ea6a3487 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iCalculationDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iCalculationDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iCalculationDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs index cb58384d..38c400db 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iCalculationUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iCalculationUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iCalculationUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseDefinitionSerializer.cs index 9353815a..fd5590a3 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iCaseDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iCaseDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iCaseDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs index cf90c6ab..cfd9718c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iCaseUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iCaseUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iCaseUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassSerializer.cs index 21c54999..40d5f018 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iClass.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iClass.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iClass.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassifierSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassifierSerializer.cs index fb015cf8..22e171bc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassifierSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ClassifierSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iClassifier.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iClassifier.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iClassifier.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CollectExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CollectExpressionSerializer.cs index 2a4dde16..e8b07282 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CollectExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CollectExpressionSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iCollectExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iCollectExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iCollectExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CommentSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CommentSerializer.cs index 9142e2f2..91755463 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CommentSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CommentSerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("annotation"u8); foreach (var item in iComment.Annotation) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -96,14 +99,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iComment.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iComment.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iComment.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernDefinitionSerializer.cs index 4262abd1..c3815697 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConcernDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iConcernDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConcernDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs index d59f29ac..3a08fd7b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConcernUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iConcernUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConcernUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortDefinitionSerializer.cs index 811177eb..47e727da 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConjugatedPortDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iConjugatedPortDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortTypingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortTypingSerializer.cs index 8b86bf8f..d927ee96 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortTypingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugatedPortTypingSerializer.cs @@ -72,7 +72,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteEndArray(); writer.WritePropertyName("conjugatedPortDefinition"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.ConjugatedPortDefinition); + writer.WriteEndObject(); writer.WritePropertyName("declaredName"u8); writer.WriteStringValue(iConjugatedPortTyping.DeclaredName); @@ -82,7 +85,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iConjugatedPortTyping.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iConjugatedPortTyping.IsImplied); @@ -93,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iConjugatedPortTyping.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConjugatedPortTyping.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iConjugatedPortTyping.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iConjugatedPortTyping.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,25 +143,40 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iConjugatedPortTyping.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.Specific); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iConjugatedPortTyping.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.Type); + writer.WriteEndObject(); writer.WritePropertyName("typedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugatedPortTyping.TypedFeature); + writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugationSerializer.cs index 0b1b460b..472d15b6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConjugationSerializer.cs @@ -72,7 +72,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteEndArray(); writer.WritePropertyName("conjugatedType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugation.ConjugatedType); + writer.WriteEndObject(); writer.WritePropertyName("declaredName"u8); writer.WriteStringValue(iConjugation.DeclaredName); @@ -88,26 +91,38 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iConjugation.IsImpliedIncluded); writer.WritePropertyName("originalType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugation.OriginalType); + writer.WriteEndObject(); writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iConjugation.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConjugation.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iConjugation.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugation.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iConjugation.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConjugation.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iConjugation.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iConjugation.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs index 32707420..c909c809 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs @@ -99,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iConnectionDefinition.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConnectionDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iConnectionDefinition.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConnectionDefinition.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -122,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iConnectionDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConnectionDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -131,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iConnectionDefinition.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iConnectionDefinition.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs index 7a412b5f..528d0d83 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs @@ -132,21 +132,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iConnectionUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConnectionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iConnectionUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConnectionUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -155,7 +164,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iConnectionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConnectionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -173,14 +185,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iConnectionUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iConnectionUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs index 27f8fb69..c0253656 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs @@ -126,21 +126,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iConnector.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConnector.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iConnector.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConnector.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -149,7 +158,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iConnector.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConnector.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -158,14 +170,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iConnector.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iConnector.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintDefinitionSerializer.cs index 416b3f27..a08e43af 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConstraintDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iConstraintDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConstraintDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs index c090053c..8a953236 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iConstraintUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iConstraintUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iConstraintUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DataTypeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DataTypeSerializer.cs index 33d0e7c8..45e0c23c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DataTypeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DataTypeSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDataType.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iDataType.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDataType.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs index 76bcb5f0..9509ca16 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDecisionNode.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iDecisionNode.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDecisionNode.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DefinitionSerializer.cs index 5ae9c0a4..e6a481a7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DefinitionSerializer.cs @@ -93,14 +93,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DependencySerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DependencySerializer.cs index 07edbf88..4e48d11a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DependencySerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DependencySerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("client"u8); foreach (var item in iDependency.Client) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -94,21 +97,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iDependency.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDependency.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iDependency.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDependency.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -117,7 +129,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iDependency.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDependency.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -126,21 +141,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iDependency.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("supplier"u8); foreach (var item in iDependency.Supplier) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iDependency.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs index c418748a..a306b880 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs @@ -76,7 +76,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("declaredShortName"u8); writer.WriteStringValue(iDifferencing.DeclaredShortName); writer.WritePropertyName("differencingType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDifferencing.DifferencingType); + writer.WriteEndObject(); writer.WritePropertyName("elementId"u8); writer.WriteStringValue(iDifferencing.ElementId); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iDifferencing.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDifferencing.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iDifferencing.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDifferencing.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iDifferencing.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDifferencing.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,14 +137,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iDifferencing.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iDifferencing.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DisjoiningSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DisjoiningSerializer.cs index fc265383..221abff2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DisjoiningSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DisjoiningSerializer.cs @@ -76,7 +76,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("declaredShortName"u8); writer.WriteStringValue(iDisjoining.DeclaredShortName); writer.WritePropertyName("disjoiningType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDisjoining.DisjoiningType); + writer.WriteEndObject(); writer.WritePropertyName("elementId"u8); writer.WriteStringValue(iDisjoining.ElementId); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iDisjoining.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDisjoining.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iDisjoining.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDisjoining.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iDisjoining.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDisjoining.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,19 +137,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iDisjoining.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iDisjoining.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("typeDisjoined"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDisjoining.TypeDisjoined); + writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DocumentationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DocumentationSerializer.cs index e46d80bc..614a69f6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DocumentationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DocumentationSerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("annotation"u8); foreach (var item in iDocumentation.Annotation) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -96,14 +99,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iDocumentation.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iDocumentation.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iDocumentation.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs index f59aac25..f86cbf75 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs @@ -85,7 +85,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iElementFilterMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iElementFilterMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iElementFilterMembership.MemberName); @@ -94,21 +97,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iElementFilterMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iElementFilterMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iElementFilterMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iElementFilterMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -117,7 +129,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iElementFilterMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iElementFilterMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -126,14 +141,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iElementFilterMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iElementFilterMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs index 1d7df420..e266a120 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iEndFeatureMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEndFeatureMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iEndFeatureMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iEndFeatureMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEndFeatureMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iEndFeatureMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iEndFeatureMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iEndFeatureMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iEndFeatureMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEndFeatureMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iEndFeatureMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEndFeatureMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iEndFeatureMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iEndFeatureMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEndFeatureMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iEndFeatureMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs index 7c0eabc9..cb20585f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs @@ -93,14 +93,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iEnumerationDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iEnumerationDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEnumerationDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs index 4e6e23c0..1bdb4457 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iEnumerationUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iEnumerationUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEnumerationUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs index ac0f246c..72e7a033 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iEventOccurrenceUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iEventOccurrenceUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iEventOccurrenceUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs index 782fd2bc..0f04508d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs @@ -129,14 +129,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iExhibitStateUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iExhibitStateUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iExhibitStateUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExpressionSerializer.cs index 554b61fd..af4de256 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExpressionSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainExpressionSerializer.cs index 73a96cce..2d46d095 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainExpressionSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureChainExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iFeatureChainExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureChainExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs index a610c46e..087cf5cf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs @@ -72,7 +72,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteEndArray(); writer.WritePropertyName("chainingFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureChaining.ChainingFeature); + writer.WriteEndObject(); writer.WritePropertyName("declaredName"u8); writer.WriteStringValue(iFeatureChaining.DeclaredName); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureChaining.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureChaining.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFeatureChaining.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureChaining.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFeatureChaining.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureChaining.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,14 +137,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFeatureChaining.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFeatureChaining.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureInvertingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureInvertingSerializer.cs index 6271a5a2..ff85672b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureInvertingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureInvertingSerializer.cs @@ -79,10 +79,16 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iFeatureInverting.ElementId); writer.WritePropertyName("featureInverted"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureInverting.FeatureInverted); + writer.WriteEndObject(); writer.WritePropertyName("invertingFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureInverting.InvertingFeature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iFeatureInverting.IsImplied); @@ -93,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureInverting.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureInverting.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFeatureInverting.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureInverting.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFeatureInverting.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureInverting.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFeatureInverting.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFeatureInverting.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs index 38ce36f8..065cc031 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iFeatureMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iFeatureMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iFeatureMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iFeatureMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFeatureMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFeatureMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFeatureMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFeatureMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iFeatureMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureReferenceExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureReferenceExpressionSerializer.cs index 655f41fb..0cb90481 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureReferenceExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureReferenceExpressionSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureReferenceExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iFeatureReferenceExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureReferenceExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureSerializer.cs index cf7bd079..3ab25d7b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeature.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iFeature.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeature.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureTypingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureTypingSerializer.cs index 61338794..06340649 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureTypingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureTypingSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iFeatureTyping.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureTyping.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iFeatureTyping.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureTyping.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureTyping.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFeatureTyping.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureTyping.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFeatureTyping.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureTyping.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,25 +137,40 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFeatureTyping.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureTyping.Specific); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iFeatureTyping.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureTyping.Type); + writer.WriteEndObject(); writer.WritePropertyName("typedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureTyping.TypedFeature); + writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs index 6e4f0e15..099fb356 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs @@ -91,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iFeatureValue.IsInitial); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureValue.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iFeatureValue.MemberName); @@ -100,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureValue.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFeatureValue.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFeatureValue.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureValue.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -123,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFeatureValue.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFeatureValue.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -132,14 +147,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFeatureValue.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFeatureValue.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionDefinitionSerializer.cs index 87b07553..94fa71c1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionDefinitionSerializer.cs @@ -99,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFlowConnectionDefinition.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFlowConnectionDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFlowConnectionDefinition.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFlowConnectionDefinition.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -122,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFlowConnectionDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFlowConnectionDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -131,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFlowConnectionDefinition.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFlowConnectionDefinition.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionUsageSerializer.cs index 6d848089..46446519 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowConnectionUsageSerializer.cs @@ -132,21 +132,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFlowConnectionUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFlowConnectionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFlowConnectionUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFlowConnectionUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -155,7 +164,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFlowConnectionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFlowConnectionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -173,14 +185,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFlowConnectionUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFlowConnectionUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs index a904d052..1ba08322 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iForLoopActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iForLoopActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iForLoopActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs index ce5a51c1..5170c55c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iForkNode.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iForkNode.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iForkNode.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs index 2530be0e..31806780 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iFramedConcernMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFramedConcernMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iFramedConcernMembership.IsImplied); @@ -91,7 +94,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iFramedConcernMembership.Kind.ToString().ToLower()); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFramedConcernMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iFramedConcernMembership.MemberName); @@ -100,21 +106,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFramedConcernMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFramedConcernMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iFramedConcernMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFramedConcernMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -123,7 +138,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iFramedConcernMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFramedConcernMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -132,19 +150,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iFramedConcernMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iFramedConcernMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFramedConcernMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iFramedConcernMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FunctionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FunctionSerializer.cs index 2fc983ce..608c8d94 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FunctionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FunctionSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iFunction.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iFunction.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iFunction.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs index 5faa2274..65266813 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iIfActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iIfActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iIfActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs index e309bc81..e61d520d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iIncludeUseCaseUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iIncludeUseCaseUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iIncludeUseCaseUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs index 86fd1c99..10e07f01 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs @@ -93,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iInteraction.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iInteraction.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iInteraction.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInteraction.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -116,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iInteraction.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInteraction.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -125,14 +137,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iInteraction.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iInteraction.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs index 49f301e6..a201be8d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs @@ -99,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iInterfaceDefinition.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iInterfaceDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iInterfaceDefinition.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInterfaceDefinition.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -122,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iInterfaceDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInterfaceDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -131,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iInterfaceDefinition.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iInterfaceDefinition.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs index faf7bbe8..0317a360 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs @@ -132,21 +132,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iInterfaceUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iInterfaceUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iInterfaceUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInterfaceUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -155,7 +164,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iInterfaceUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInterfaceUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -173,14 +185,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iInterfaceUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iInterfaceUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs index 42d5ab5b..07b1a961 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iIntersecting.ElementId); writer.WritePropertyName("intersectingType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iIntersecting.IntersectingType); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iIntersecting.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iIntersecting.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iIntersecting.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iIntersecting.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iIntersecting.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iIntersecting.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iIntersecting.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,14 +137,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iIntersecting.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iIntersecting.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvariantSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvariantSerializer.cs index 9fe28c69..52898139 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvariantSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvariantSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iInvariant.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iInvariant.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInvariant.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvocationExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvocationExpressionSerializer.cs index 2c81246c..c8f2365d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvocationExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InvocationExpressionSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iInvocationExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iInvocationExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iInvocationExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemDefinitionSerializer.cs index 889b7fd6..38a0ab0c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iItemDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iItemDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iItemDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFeatureSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFeatureSerializer.cs index 1332d84e..85603c8c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFeatureSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFeatureSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iItemFeature.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iItemFeature.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iItemFeature.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowEndSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowEndSerializer.cs index 6b632aed..72ba73d1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowEndSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowEndSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iItemFlowEnd.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iItemFlowEnd.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iItemFlowEnd.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowSerializer.cs index 16d9b482..72f8aaa0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemFlowSerializer.cs @@ -126,21 +126,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iItemFlow.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iItemFlow.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iItemFlow.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iItemFlow.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -149,7 +158,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iItemFlow.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iItemFlow.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -158,14 +170,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iItemFlow.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iItemFlow.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs index cc1a5dda..024a0a15 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iItemUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iItemUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iItemUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs index 7e9dc12a..6cec7bf1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iJoinNode.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iJoinNode.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iJoinNode.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LibraryPackageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LibraryPackageSerializer.cs index 53245102..09e32ef4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LibraryPackageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LibraryPackageSerializer.cs @@ -87,14 +87,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLibraryPackage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLibraryPackage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLibraryPackage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LifeClassSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LifeClassSerializer.cs index 07ad2a9b..9c65d3c8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LifeClassSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LifeClassSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLifeClass.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLifeClass.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLifeClass.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralBooleanSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralBooleanSerializer.cs index 97cc7895..1e4d4663 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralBooleanSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralBooleanSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLiteralBoolean.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLiteralBoolean.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLiteralBoolean.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralExpressionSerializer.cs index cff9dbfa..298f5bbd 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralExpressionSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLiteralExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLiteralExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLiteralExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralInfinitySerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralInfinitySerializer.cs index ed41f6ea..ef44b9c5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralInfinitySerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralInfinitySerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLiteralInfinity.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLiteralInfinity.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLiteralInfinity.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralIntegerSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralIntegerSerializer.cs index 5b204ad9..41fbb3a6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralIntegerSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralIntegerSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLiteralInteger.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLiteralInteger.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLiteralInteger.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralRationalSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralRationalSerializer.cs index d2eb2227..7662aee7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralRationalSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralRationalSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLiteralRational.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLiteralRational.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLiteralRational.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralStringSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralStringSerializer.cs index 9d911629..71d78493 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralStringSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/LiteralStringSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iLiteralString.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iLiteralString.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iLiteralString.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs index 90f6849f..df751893 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iMembershipExpose.ElementId); writer.WritePropertyName("importedMembership"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembershipExpose.ImportedMembership); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iMembershipExpose.IsImplied); @@ -96,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iMembershipExpose.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMembershipExpose.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iMembershipExpose.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembershipExpose.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -119,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iMembershipExpose.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembershipExpose.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -128,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iMembershipExpose.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iMembershipExpose.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs index 5cbb7b72..a54507e5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iMembershipImport.ElementId); writer.WritePropertyName("importedMembership"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembershipImport.ImportedMembership); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iMembershipImport.IsImplied); @@ -96,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iMembershipImport.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMembershipImport.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iMembershipImport.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembershipImport.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -119,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iMembershipImport.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembershipImport.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -128,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iMembershipImport.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iMembershipImport.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs index 93e83632..48cc6765 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs @@ -85,7 +85,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iMembership.MemberName); @@ -94,21 +97,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -117,7 +129,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -126,14 +141,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs index 3734ec97..3ef71e0c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMergeNode.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMergeNode.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMergeNode.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetaclassSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetaclassSerializer.cs index 5360395c..418c74f7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetaclassSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetaclassSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMetaclass.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMetaclass.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMetaclass.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataAccessExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataAccessExpressionSerializer.cs index 05b91708..ab4b9c38 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataAccessExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataAccessExpressionSerializer.cs @@ -120,21 +120,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMetadataAccessExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMetadataAccessExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMetadataAccessExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { writer.WriteNullValue(); } writer.WritePropertyName("referencedElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMetadataAccessExpression.ReferencedElement); + writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataDefinitionSerializer.cs index 6a9745d9..c6f03cc0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMetadataDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMetadataDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMetadataDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataFeatureSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataFeatureSerializer.cs index b0b551e9..7cb5e7a4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataFeatureSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataFeatureSerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("annotation"u8); foreach (var item in iMetadataFeature.Annotation) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -127,14 +130,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMetadataFeature.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMetadataFeature.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMetadataFeature.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs index 0f3c23f2..b2b67a73 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("annotation"u8); foreach (var item in iMetadataUsage.Annotation) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -133,14 +136,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMetadataUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMetadataUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMetadataUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs index 8faf1e11..88971702 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMultiplicityRange.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMultiplicityRange.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMultiplicityRange.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicitySerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicitySerializer.cs index 321863e1..85a2c821 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicitySerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MultiplicitySerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iMultiplicity.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iMultiplicity.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iMultiplicity.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs index 53520c7c..b961012d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iNamespaceExpose.ElementId); writer.WritePropertyName("importedNamespace"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespaceExpose.ImportedNamespace); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iNamespaceExpose.IsImplied); @@ -96,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iNamespaceExpose.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iNamespaceExpose.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iNamespaceExpose.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespaceExpose.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -119,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iNamespaceExpose.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespaceExpose.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -128,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iNamespaceExpose.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iNamespaceExpose.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs index b6baabbc..fa36ee07 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iNamespaceImport.ElementId); writer.WritePropertyName("importedNamespace"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespaceImport.ImportedNamespace); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iNamespaceImport.IsImplied); @@ -96,21 +99,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iNamespaceImport.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iNamespaceImport.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iNamespaceImport.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespaceImport.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -119,7 +131,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iNamespaceImport.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespaceImport.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -128,14 +143,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iNamespaceImport.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iNamespaceImport.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceSerializer.cs index f5038c43..0843fbd8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceSerializer.cs @@ -84,14 +84,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iNamespace.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iNamespace.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNamespace.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NullExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NullExpressionSerializer.cs index e1b5f1cd..2e707ead 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NullExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NullExpressionSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iNullExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iNullExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iNullExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs index c1d36273..a4989290 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iObjectiveMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iObjectiveMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iObjectiveMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iObjectiveMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iObjectiveMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iObjectiveMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iObjectiveMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iObjectiveMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iObjectiveMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iObjectiveMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iObjectiveMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iObjectiveMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iObjectiveMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iObjectiveMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iObjectiveMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iObjectiveMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceDefinitionSerializer.cs index cf88dae8..e58def7c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iOccurrenceDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iOccurrenceDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iOccurrenceDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs index 7fa4d2cc..1b2f3964 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iOccurrenceUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iOccurrenceUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iOccurrenceUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OperatorExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OperatorExpressionSerializer.cs index 3a3b0cd7..f9a3305b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OperatorExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OperatorExpressionSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iOperatorExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iOperatorExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iOperatorExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs index efd54b09..a03c6083 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs @@ -85,7 +85,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iOwningMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iOwningMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iOwningMembership.MemberName); @@ -94,21 +97,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iOwningMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iOwningMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iOwningMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iOwningMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -117,7 +129,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iOwningMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iOwningMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -126,14 +141,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iOwningMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iOwningMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PackageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PackageSerializer.cs index f2fa751c..b27ee098 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PackageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PackageSerializer.cs @@ -84,14 +84,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPackage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPackage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPackage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs index 7dcf85ac..30981cda 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iParameterMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iParameterMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iParameterMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iParameterMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iParameterMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iParameterMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iParameterMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iParameterMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iParameterMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iParameterMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iParameterMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iParameterMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iParameterMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iParameterMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iParameterMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iParameterMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartDefinitionSerializer.cs index 9c006084..ba8f7aec 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPartDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPartDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPartDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs index 3abf62a5..d4f261c5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPartUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPartUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPartUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs index fd951d5c..19d66baa 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPerformActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPerformActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPerformActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortConjugationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortConjugationSerializer.cs index 13eeca98..306f5bcc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortConjugationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortConjugationSerializer.cs @@ -72,7 +72,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteEndArray(); writer.WritePropertyName("conjugatedType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortConjugation.ConjugatedType); + writer.WriteEndObject(); writer.WritePropertyName("declaredName"u8); writer.WriteStringValue(iPortConjugation.DeclaredName); @@ -88,29 +91,44 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iPortConjugation.IsImpliedIncluded); writer.WritePropertyName("originalPortDefinition"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortConjugation.OriginalPortDefinition); + writer.WriteEndObject(); writer.WritePropertyName("originalType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortConjugation.OriginalType); + writer.WriteEndObject(); writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iPortConjugation.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPortConjugation.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iPortConjugation.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortConjugation.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -119,7 +137,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iPortConjugation.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortConjugation.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -128,14 +149,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iPortConjugation.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iPortConjugation.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortDefinitionSerializer.cs index 1b7c6449..9b389378 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPortDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPortDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs index 94e42346..1d8e2290 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPortUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPortUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPortUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PredicateSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PredicateSerializer.cs index bd10ba78..9b121875 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PredicateSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PredicateSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iPredicate.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iPredicate.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iPredicate.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RedefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RedefinitionSerializer.cs index 082b49e4..549feb35 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RedefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RedefinitionSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iRedefinition.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iRedefinition.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iRedefinition.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRedefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iRedefinition.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,38 +125,62 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iRedefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { writer.WriteNullValue(); } writer.WritePropertyName("redefinedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.RedefinedFeature); + writer.WriteEndObject(); writer.WritePropertyName("redefiningFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.RedefiningFeature); + writer.WriteEndObject(); writer.WriteStartArray("source"u8); foreach (var item in iRedefinition.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.Specific); + writer.WriteEndObject(); writer.WritePropertyName("subsettedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.SubsettedFeature); + writer.WriteEndObject(); writer.WritePropertyName("subsettingFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRedefinition.SubsettingFeature); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iRedefinition.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs index a231110c..432716a5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iReferenceSubsetting.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iReferenceSubsetting.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iReferenceSubsetting.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iReferenceSubsetting.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iReferenceSubsetting.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,35 +125,56 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iReferenceSubsetting.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.OwningRelationship.Value); + writer.WriteEndObject(); } else { writer.WriteNullValue(); } writer.WritePropertyName("referencedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.ReferencedFeature); + writer.WriteEndObject(); writer.WriteStartArray("source"u8); foreach (var item in iReferenceSubsetting.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.Specific); + writer.WriteEndObject(); writer.WritePropertyName("subsettedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.SubsettedFeature); + writer.WriteEndObject(); writer.WritePropertyName("subsettingFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceSubsetting.SubsettingFeature); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iReferenceSubsetting.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs index 9096fbea..15f99ff7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iReferenceUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iReferenceUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReferenceUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingDefinitionSerializer.cs index 6943231b..25aba915 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRenderingDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iRenderingDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRenderingDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs index 3e78eccb..67d384ec 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRenderingUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iRenderingUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRenderingUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs index 2ac6b280..4b8439e4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iRequirementConstraintMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementConstraintMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iRequirementConstraintMembership.IsImplied); @@ -91,7 +94,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iRequirementConstraintMembership.Kind.ToString().ToLower()); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementConstraintMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iRequirementConstraintMembership.MemberName); @@ -100,21 +106,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iRequirementConstraintMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRequirementConstraintMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iRequirementConstraintMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementConstraintMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -123,7 +138,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iRequirementConstraintMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementConstraintMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -132,19 +150,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iRequirementConstraintMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iRequirementConstraintMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementConstraintMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iRequirementConstraintMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementDefinitionSerializer.cs index 5a5fef39..77199f7f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRequirementDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iRequirementDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs index 5b271a43..75546b9b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRequirementUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iRequirementUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs index 1655a217..f2ce8c3b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iRequirementVerificationMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementVerificationMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iRequirementVerificationMembership.IsImplied); @@ -91,7 +94,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iRequirementVerificationMembership.Kind.ToString().ToLower()); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementVerificationMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iRequirementVerificationMembership.MemberName); @@ -100,21 +106,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iRequirementVerificationMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iRequirementVerificationMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iRequirementVerificationMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementVerificationMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -123,7 +138,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iRequirementVerificationMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementVerificationMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -132,19 +150,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iRequirementVerificationMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iRequirementVerificationMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iRequirementVerificationMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iRequirementVerificationMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs index 968ba799..2ccd80fb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iResultExpressionMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iResultExpressionMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iResultExpressionMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iResultExpressionMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iResultExpressionMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iResultExpressionMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iResultExpressionMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iResultExpressionMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iResultExpressionMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iResultExpressionMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iResultExpressionMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iResultExpressionMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iResultExpressionMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iResultExpressionMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iResultExpressionMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iResultExpressionMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs index f89665c0..72ad1175 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iReturnParameterMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReturnParameterMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iReturnParameterMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iReturnParameterMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReturnParameterMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iReturnParameterMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iReturnParameterMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iReturnParameterMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iReturnParameterMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReturnParameterMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iReturnParameterMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReturnParameterMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iReturnParameterMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iReturnParameterMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iReturnParameterMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iReturnParameterMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs index 63d993ce..42d34152 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs @@ -129,14 +129,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSatisfyRequirementUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iSatisfyRequirementUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSatisfyRequirementUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SelectExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SelectExpressionSerializer.cs index 6c847a7a..fb20921e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SelectExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SelectExpressionSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSelectExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iSelectExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSelectExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs index 376288d6..48270802 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSendActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iSendActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSendActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SpecializationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SpecializationSerializer.cs index 7ba135f2..321b4745 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SpecializationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SpecializationSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iSpecialization.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSpecialization.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iSpecialization.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSpecialization.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSpecialization.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSpecialization.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSpecialization.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSpecialization.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSpecialization.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,17 +137,26 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSpecialization.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSpecialization.Specific); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iSpecialization.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs index f226e698..e899e6dc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iStakeholderMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStakeholderMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iStakeholderMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iStakeholderMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStakeholderMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iStakeholderMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iStakeholderMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iStakeholderMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iStakeholderMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStakeholderMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iStakeholderMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStakeholderMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iStakeholderMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iStakeholderMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStakeholderMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iStakeholderMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateDefinitionSerializer.cs index 54c00608..cbe1832d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateDefinitionSerializer.cs @@ -99,14 +99,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iStateDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iStateDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs index 9b050052..193a1e6c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iStateSubactionMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateSubactionMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iStateSubactionMembership.IsImplied); @@ -91,7 +94,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iStateSubactionMembership.Kind.ToString().ToLower()); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateSubactionMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iStateSubactionMembership.MemberName); @@ -100,21 +106,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iStateSubactionMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iStateSubactionMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iStateSubactionMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateSubactionMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -123,7 +138,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iStateSubactionMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateSubactionMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -132,19 +150,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iStateSubactionMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iStateSubactionMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateSubactionMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iStateSubactionMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs index b4513d27..810fca4b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs @@ -129,14 +129,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iStateUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iStateUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStateUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StepSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StepSerializer.cs index 1e849de2..360b5cd1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StepSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StepSerializer.cs @@ -120,14 +120,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iStep.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iStep.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStep.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StructureSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StructureSerializer.cs index 60595fce..a816ac71 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StructureSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StructureSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iStructure.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iStructure.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iStructure.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubclassificationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubclassificationSerializer.cs index c76d01c9..d1e854f4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubclassificationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubclassificationSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iSubclassification.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubclassification.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iSubclassification.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSubclassification.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSubclassification.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSubclassification.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubclassification.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSubclassification.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubclassification.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,23 +137,38 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSubclassification.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubclassification.Specific); + writer.WriteEndObject(); writer.WritePropertyName("subclassifier"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubclassification.Subclassifier); + writer.WriteEndObject(); writer.WritePropertyName("superclassifier"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubclassification.Superclassifier); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iSubclassification.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs index f6a43ae9..dccd7df8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iSubjectMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubjectMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iSubjectMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iSubjectMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubjectMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iSubjectMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSubjectMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSubjectMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSubjectMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubjectMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSubjectMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubjectMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSubjectMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iSubjectMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubjectMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iSubjectMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubsettingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubsettingSerializer.cs index 34c01b99..dace737c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubsettingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubsettingSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iSubsetting.ElementId); writer.WritePropertyName("general"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubsetting.General); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iSubsetting.IsImplied); @@ -90,21 +93,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSubsetting.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSubsetting.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSubsetting.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubsetting.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -113,7 +125,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSubsetting.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubsetting.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -122,23 +137,38 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSubsetting.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("specific"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubsetting.Specific); + writer.WriteEndObject(); writer.WritePropertyName("subsettedFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubsetting.SubsettedFeature); + writer.WriteEndObject(); writer.WritePropertyName("subsettingFeature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSubsetting.SubsettingFeature); + writer.WriteEndObject(); writer.WriteStartArray("target"u8); foreach (var item in iSubsetting.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs index 0c6559d4..2a892a93 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs @@ -129,21 +129,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSuccessionAsUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSuccessionAsUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSuccessionAsUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccessionAsUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -152,7 +161,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSuccessionAsUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccessionAsUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -161,14 +173,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSuccessionAsUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iSuccessionAsUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowConnectionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowConnectionUsageSerializer.cs index 574d5095..cba238a1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowConnectionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowConnectionUsageSerializer.cs @@ -132,21 +132,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSuccessionFlowConnectionUsage.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSuccessionFlowConnectionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSuccessionFlowConnectionUsage.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccessionFlowConnectionUsage.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -155,7 +164,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSuccessionFlowConnectionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccessionFlowConnectionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -173,14 +185,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSuccessionFlowConnectionUsage.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iSuccessionFlowConnectionUsage.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionItemFlowSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionItemFlowSerializer.cs index aa887632..e519a017 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionItemFlowSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionItemFlowSerializer.cs @@ -126,21 +126,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSuccessionItemFlow.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSuccessionItemFlow.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSuccessionItemFlow.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccessionItemFlow.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -149,7 +158,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSuccessionItemFlow.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccessionItemFlow.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -158,14 +170,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSuccessionItemFlow.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iSuccessionItemFlow.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs index 3d75685d..fcfb1fcf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs @@ -126,21 +126,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSuccession.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iSuccession.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iSuccession.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccession.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -149,7 +158,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iSuccession.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iSuccession.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -158,14 +170,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iSuccession.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iSuccession.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TextualRepresentationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TextualRepresentationSerializer.cs index 77c38261..4f209b89 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TextualRepresentationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TextualRepresentationSerializer.cs @@ -74,7 +74,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("annotation"u8); foreach (var item in iTextualRepresentation.Annotation) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); @@ -97,14 +100,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iTextualRepresentation.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iTextualRepresentation.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTextualRepresentation.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs index f11ea8aa..fd57b909 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iTransitionFeatureMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTransitionFeatureMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iTransitionFeatureMembership.IsImplied); @@ -91,7 +94,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iTransitionFeatureMembership.Kind.ToString().ToLower()); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTransitionFeatureMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iTransitionFeatureMembership.MemberName); @@ -100,21 +106,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iTransitionFeatureMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iTransitionFeatureMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iTransitionFeatureMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTransitionFeatureMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -123,7 +138,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iTransitionFeatureMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTransitionFeatureMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -132,19 +150,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iTransitionFeatureMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iTransitionFeatureMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTransitionFeatureMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iTransitionFeatureMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs index 383680d3..30734c3c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iTransitionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iTransitionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTransitionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs index 70ed8782..199a630d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TriggerInvocationExpressionSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iTriggerInvocationExpression.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iTriggerInvocationExpression.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTriggerInvocationExpression.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeFeaturingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeFeaturingSerializer.cs index 92c1a8c4..aeedd16c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeFeaturingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeFeaturingSerializer.cs @@ -79,13 +79,22 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iTypeFeaturing.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTypeFeaturing.Feature); + writer.WriteEndObject(); writer.WritePropertyName("featureOfType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTypeFeaturing.FeatureOfType); + writer.WriteEndObject(); writer.WritePropertyName("featuringType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTypeFeaturing.FeaturingType); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iTypeFeaturing.IsImplied); @@ -96,21 +105,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iTypeFeaturing.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iTypeFeaturing.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iTypeFeaturing.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTypeFeaturing.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -119,7 +137,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iTypeFeaturing.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTypeFeaturing.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -128,19 +149,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iTypeFeaturing.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iTypeFeaturing.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iTypeFeaturing.Type); + writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeSerializer.cs index e0682559..96287d4f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TypeSerializer.cs @@ -90,14 +90,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iType.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iType.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iType.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs index efa9f14a..1f8be59a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs @@ -87,21 +87,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iUnioning.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iUnioning.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iUnioning.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iUnioning.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -110,7 +119,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iUnioning.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iUnioning.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -119,19 +131,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iUnioning.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iUnioning.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("unioningType"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iUnioning.UnioningType); + writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs index c2920310..baade6b9 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs @@ -123,14 +123,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseDefinitionSerializer.cs index 1c96d3cf..0275c700 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iUseCaseDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iUseCaseDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iUseCaseDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs index ca42e6b5..23207924 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iUseCaseUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iUseCaseUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iUseCaseUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs index e9107564..9e379c27 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs @@ -85,7 +85,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iVariantMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iVariantMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iVariantMembership.MemberName); @@ -94,21 +97,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iVariantMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iVariantMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iVariantMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iVariantMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -117,7 +129,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iVariantMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iVariantMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -126,14 +141,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iVariantMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iVariantMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseDefinitionSerializer.cs index 21cab109..ce336f0a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iVerificationCaseDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iVerificationCaseDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iVerificationCaseDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs index 72dfc97b..a5fefa6c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iVerificationCaseUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iVerificationCaseUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iVerificationCaseUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewDefinitionSerializer.cs index fcf403e9..84e0f5c7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iViewDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iViewDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs index 30edcf77..0db436f0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs @@ -79,7 +79,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStringValue(iViewRenderingMembership.ElementId); writer.WritePropertyName("feature"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewRenderingMembership.Feature); + writer.WriteEndObject(); writer.WritePropertyName("isImplied"u8); writer.WriteBooleanValue(iViewRenderingMembership.IsImplied); @@ -88,7 +91,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteBooleanValue(iViewRenderingMembership.IsImpliedIncluded); writer.WritePropertyName("memberElement"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewRenderingMembership.MemberElement); + writer.WriteEndObject(); writer.WritePropertyName("memberName"u8); writer.WriteStringValue(iViewRenderingMembership.MemberName); @@ -97,21 +103,30 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iViewRenderingMembership.OwnedRelatedElement) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iViewRenderingMembership.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelatedElement"u8); if (iViewRenderingMembership.OwningRelatedElement.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewRenderingMembership.OwningRelatedElement.Value); + writer.WriteEndObject(); } else { @@ -120,7 +135,10 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WritePropertyName("owningRelationship"u8); if (iViewRenderingMembership.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewRenderingMembership.OwningRelationship.Value); + writer.WriteEndObject(); } else { @@ -129,19 +147,28 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("source"u8); foreach (var item in iViewRenderingMembership.Source) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteStartArray("target"u8); foreach (var item in iViewRenderingMembership.Target) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("type"u8); + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewRenderingMembership.Type); + writer.WriteEndObject(); writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iViewRenderingMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs index 74b16684..ffcd1830 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iViewUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iViewUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointDefinitionSerializer.cs index 2b3dbe38..b93d817b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointDefinitionSerializer.cs @@ -96,14 +96,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iViewpointDefinition.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iViewpointDefinition.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewpointDefinition.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs index 96afb9a2..9841ece3 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iViewpointUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iViewpointUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iViewpointUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs index 46b3d72c..a8687069 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs @@ -126,14 +126,20 @@ internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationM writer.WriteStartArray("ownedRelationship"u8); foreach (var item in iWhileLoopActionUsage.OwnedRelationship) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(item); + writer.WriteEndObject(); } writer.WriteEndArray(); writer.WritePropertyName("owningRelationship"u8); if (iWhileLoopActionUsage.OwningRelationship.HasValue) { + writer.WriteStartObject(); + writer.WritePropertyName("@id"u8); writer.WriteStringValue(iWhileLoopActionUsage.OwningRelationship.Value); + writer.WriteEndObject(); } else { diff --git a/SysML2.NET.Serializer.Json/PIM/ProjectDeSerializer.cs b/SysML2.NET.Serializer.Json/PIM/ProjectDeSerializer.cs index daa45b39..6b7235f0 100644 --- a/SysML2.NET.Serializer.Json/PIM/ProjectDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/PIM/ProjectDeSerializer.cs @@ -99,7 +99,15 @@ internal static Project DeSerialize(JsonElement jsonElement, SerializationModeKi if (jsonElement.TryGetProperty("created"u8, out JsonElement createdProperty)) { - dtoInstance.Created = createdProperty.GetDateTime(); + + if (createdProperty.ValueKind != JsonValueKind.Null) + { + dtoInstance.Created = createdProperty.GetDateTime(); + } + else + { + logger.LogDebug($"the created Json property was null in the Project: {dtoInstance.Id}"); + } } else { diff --git a/SysML2.NET.Serializer.Json/SysML2.NET.Serializer.Json.csproj b/SysML2.NET.Serializer.Json/SysML2.NET.Serializer.Json.csproj index 4b4cd80b..b251c045 100644 --- a/SysML2.NET.Serializer.Json/SysML2.NET.Serializer.Json.csproj +++ b/SysML2.NET.Serializer.Json/SysML2.NET.Serializer.Json.csproj @@ -3,7 +3,7 @@ netstandard2.0 11.0 - 0.11.0 + 0.11.1 A .NET implementation of the OMG SysML v2 JSON serializer. SysML2.NET.Serializer.Json RHEA System S.A. @@ -24,7 +24,7 @@ - +