Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate that a recursive complex-typed property must be nullable #2512

Closed
mikepizzo opened this issue Sep 26, 2022 · 0 comments · Fixed by #2558
Closed

Validate that a recursive complex-typed property must be nullable #2512

mikepizzo opened this issue Sep 26, 2022 · 0 comments · Fixed by #2558
Assignees

Comments

@mikepizzo
Copy link
Member

mikepizzo commented Sep 26, 2022

Marking a recursive complex-typed property as non-nullable would lead to an infinite recursion. For example:

⁠<ComplexType Name="myType>
    <Property Name="nested" Type="self.myType" Nullable="false">
</ComplexType>

or

⁠<ComplexType Name="myType>
    <Property Name="nested" Type="self.derivedType" Nullable="false">
</ComplexType>

⁠<ComplexType Name="derivedType" BaseType="self.myType">
    <Property Name="foo" Type="Edm.String">
</ComplexType>

We should validate against the above definitions (similar to our existing rule "ValidationRules.NavigationPropertyWithRecursiveContainmentTargetMustBeOptional"

Assemblies affected

EdmLib.dll

Reproduce steps

Create and validate the above model.

Expected result

A validation error saying that a recursive complex-typed property must be nullable.

Actual result

No error.

Additional detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants