You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a summary of compliance checks for this PR:
Security Compliance
⚪
Potential null handling
Description: The new primary-constructor record NodeRemoteValue(string? SharedId, NodeProperties? Value) makes SharedId and Value optional, which can lead to null dereference or logic errors if downstream code assumes these were always populated by deserialization when previously guarded by JsonInclude. RemoteValue.cs [255-260]
nvborisenko
changed the title
[dotnet] [biid] Avoid using JsonInclude attribute to include optional property for DTO
[dotnet] [bidi] Avoid using JsonInclude attribute to include optional property for DTO
Oct 11, 2025
-public sealed record NodeRemoteValue(string? SharedId, NodeProperties? Value) : RemoteValue, ISharedReference-{- public Handle? Handle { get; set; }+public sealed record NodeRemoteValue(string? SharedId, NodeProperties? Value, Handle? Handle, InternalId? InternalId) : RemoteValue, ISharedReference;- public InternalId? InternalId { get; set; }-}-
Apply / Chat
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies that Handle and InternalId are mutable properties and proposes moving them to the primary constructor, which improves immutability and consistency with the record's design.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
💥 What does this PR do?
Simplifies DTO definitions.
JsonIncludeattribute leads to messing.🔧 Implementation Notes
I am applied it everywhere is possible.
🔄 Types of changes
PR Type
Other
Description
Remove JsonInclude attributes from BiDi DTO classes
Convert properties to constructor parameters in records
Simplify serialization by using primary constructors
Update network event handlers with new signatures
Diagram Walkthrough
File Walkthrough
14 files
Convert Parent property to constructor parameterAdd Intercepts parameter to event handlersConvert UserText property to constructor parameterConvert DefaultValue property to constructor parameterAdd Intercepts parameter to constructorConvert Intercepts property to constructor parameterAdd Intercepts parameter to constructorAdd Intercepts parameter to constructorUpdate intercepted event constructors with InterceptsAdd Intercepts parameter to constructorConvert AuthChallenges property to constructor parameterAdd Intercepts parameter to constructorConvert all properties to constructor parametersConvert SharedId and Value to constructor parameters