Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ SysML2.NET.Serializer.TextualNotation - Writers/, AutoGenTextualNotationBuilder/
SysML2.NET.Dal - Data Access Layer (Assembler, ElementFactory)
SysML2.NET.REST - REST client + Session
SysML2.NET.Kpar - Reader/Writer for .kpar archives
SysML2.NET.Validation - FluentValidation validators for the PSM request DTOs (PSM/AutoGenValidator/, generated)
SysML2.NET.Validation - FluentValidation validators for the PSM request DTOs (PSM/AutoGenValidator/) and the Core DTOs (Core/DTO/AutoGenValidator/), generated
SysML2.NET.Viewer - Blazor WebAssembly app (net9.0)
SysML2.NET.CodeGenerator - Code generation tool (net10.0, not packaged)
```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="AnnotatingElementValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.DTO.Root.Annotations;

/// <summary>
/// Validates a <see cref="AnnotatingElement"/> against the multiplicities and types of the non-derived properties of the AnnotatingElement metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class AnnotatingElementValidator : DtoValidator<AnnotatingElement>
{
/// <summary>
/// Initializes a new instance of the <see cref="AnnotatingElementValidator"/> class
/// and registers its generated rules
/// </summary>
public AnnotatingElementValidator()
{
this.RuleFor(dto => dto.ElementId).NotNull();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="AssociationValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.DTO.Kernel.Associations;

/// <summary>
/// Validates a <see cref="Association"/> against the multiplicities and types of the non-derived properties of the Association metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class AssociationValidator : DtoValidator<Association>
{
/// <summary>
/// Initializes a new instance of the <see cref="AssociationValidator"/> class
/// and registers its generated rules
/// </summary>
public AssociationValidator()
{
this.RuleFor(dto => dto.ElementId).NotNull();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="DependencyValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.DTO.Root.Dependencies;

/// <summary>
/// Validates a <see cref="Dependency"/> against the multiplicities and types of the non-derived properties of the Dependency metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class DependencyValidator : DtoValidator<Dependency>
{
/// <summary>
/// Initializes a new instance of the <see cref="DependencyValidator"/> class
/// and registers its generated rules
/// </summary>
public DependencyValidator()
{
this.RuleFor(dto => dto.Client).NotEmpty();
this.RuleFor(dto => dto.ElementId).NotNull();
this.RuleFor(dto => dto.Supplier).NotEmpty();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="EnumerationDefinitionValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.DTO.Systems.Enumerations;

/// <summary>
/// Validates a <see cref="EnumerationDefinition"/> against the multiplicities and types of the non-derived properties of the EnumerationDefinition metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class EnumerationDefinitionValidator : DtoValidator<EnumerationDefinition>
{
/// <summary>
/// Initializes a new instance of the <see cref="EnumerationDefinitionValidator"/> class
/// and registers its generated rules
/// </summary>
public EnumerationDefinitionValidator()
{
this.RuleFor(dto => dto.ElementId).NotNull();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="FeatureTypingValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.DTO.Core.Features;

/// <summary>
/// Validates a <see cref="FeatureTyping"/> against the multiplicities and types of the non-derived properties of the FeatureTyping metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class FeatureTypingValidator : DtoValidator<FeatureTyping>
{
/// <summary>
/// Initializes a new instance of the <see cref="FeatureTypingValidator"/> class
/// and registers its generated rules
/// </summary>
public FeatureTypingValidator()
{
this.RuleFor(dto => dto.ElementId).NotNull();
this.RuleFor(dto => dto.Type).NotEmpty();
this.RuleFor(dto => dto.TypedFeature).NotEmpty();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="FeatureValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.Core.Types;
using SysML2.NET.Core.DTO.Core.Features;

/// <summary>
/// Validates a <see cref="Feature"/> against the multiplicities and types of the non-derived properties of the Feature metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class FeatureValidator : DtoValidator<Feature>
{
/// <summary>
/// Initializes a new instance of the <see cref="FeatureValidator"/> class
/// and registers its generated rules
/// </summary>
public FeatureValidator()
{
this.RuleFor(dto => dto.Direction).IsInEnum();
this.RuleFor(dto => dto.ElementId).NotNull();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="FlowValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.Core.Types;
using SysML2.NET.Core.DTO.Kernel.Interactions;

/// <summary>
/// Validates a <see cref="Flow"/> against the multiplicities and types of the non-derived properties of the Flow metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class FlowValidator : DtoValidator<Flow>
{
/// <summary>
/// Initializes a new instance of the <see cref="FlowValidator"/> class
/// and registers its generated rules
/// </summary>
public FlowValidator()
{
this.RuleFor(dto => dto.Direction).IsInEnum();
this.RuleFor(dto => dto.ElementId).NotNull();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// ------------------------------------------------------------------------------------------------
// <copyright file="FramedConcernMembershipValidator.cs" company="Starion Group S.A.">
//
// Copyright (C) 2022-2026 Starion Group S.A.
// SPDX-License-Identifier: Apache-2.0
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// <auto-generated />
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace SysML2.NET.Validation.Core.DTO
{
using System.CodeDom.Compiler;

using FluentValidation;

using SysML2.NET.Core.Root.Namespaces;
using SysML2.NET.Core.Systems.Requirements;
using SysML2.NET.Core.DTO.Systems.Requirements;

/// <summary>
/// Validates a <see cref="FramedConcernMembership"/> against the multiplicities and types of the non-derived properties of the FramedConcernMembership metaclass.
/// A rule inferred from a required derived property only checks the lower bound of its storage, not its upper bound or element type.
/// </summary>
[GeneratedCode("SysML2.NET", "latest")]
public sealed partial class FramedConcernMembershipValidator : DtoValidator<FramedConcernMembership>
{
/// <summary>
/// Initializes a new instance of the <see cref="FramedConcernMembershipValidator"/> class
/// and registers its generated rules
/// </summary>
public FramedConcernMembershipValidator()
{
this.RuleFor(dto => dto.ElementId).NotNull();
this.RuleFor(dto => dto.Kind).IsInEnum();
this.RuleFor(dto => dto.OwnedRelatedElement).NotEmpty();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule is computed based on the need of derived property.
Pure error shall come on non-derived property.
I would prefer to se the severity as Warning when a rule is there due to a derivation check

this.RuleFor(dto => dto.OwningRelatedElement).NotEmpty();
this.RuleFor(dto => dto.Visibility).IsInEnum();
}
}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Loading
Loading