Skip to content

Conversation

@sanych-sun
Copy link
Member

No description provided.

@sanych-sun sanych-sun requested a review from a team as a code owner February 12, 2026 00:56
@sanych-sun sanych-sun requested review from Copilot and rstam February 12, 2026 00:56
@sanych-sun sanych-sun added the bug Fixes issues or unintended behavior. label Feb 12, 2026
@sanych-sun sanych-sun requested review from papafe and removed request for rstam February 12, 2026 00:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds coverage and a serializer tweak to ensure IPAddressSerializer can handle special/built-in IPAddress instances (e.g., IPAddress.Any, Broadcast, IPv6 special values) without throwing.

Changes:

  • Added theory test cases covering special IPAddress values for JSON (Shell mode) and BSON roundtrips.
  • Overrode IPAddressSerializer.Serialize to force nominal-type serialization (SerializeAsNominalType = true) before delegating to the base implementation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/MongoDB.Bson.Tests/Serialization/Serializers/NetPrimitiveSerializerTests.cs Adds theory + member data to validate special IPAddress values serialize/roundtrip correctly.
src/MongoDB.Bson/Serialization/Serializers/IPAddressSerializer.cs Forces nominal-type serialization to avoid failures when serializing special/built-in IPAddress instances.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sanych-sun sanych-sun added bug Fixes issues or unintended behavior. and removed bug Fixes issues or unintended behavior. labels Feb 12, 2026
@sanych-sun sanych-sun changed the title CSHARP-5863: The built-in IPAddressSerializer throws when using IPAddress.Any, etc. CSHARP-5863: The built-in IPAddressSerializer throws when using IPAddress.Any, etc Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes issues or unintended behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant