Skip to content

Conversation

@davidhewitt
Copy link
Contributor

Change Summary

This adds serialization for IP address types, which was a pain point of Pydantic 2.12's changes to serialize_as_any.

Related issue number

Fixes #1856

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@davidhewitt davidhewitt requested a review from Viicos October 31, 2025 14:28
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 31, 2025

CodSpeed Performance Report

Merging #1868 will not alter performance

Comparing dh/infer-ip-addr (ab61999) with main (191187a)

Summary

✅ 163 untouched

Copy link
Member

@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

I think we should apply the same to the network types?

@davidhewitt
Copy link
Contributor Author

Good point, and probably also interfaces 👍

@davidhewitt
Copy link
Contributor Author

davidhewitt commented Oct 31, 2025

Ah interfaces are already subclasses of IpAddress types, so no need for those to be added to code, I'll just add them to tests.

@davidhewitt davidhewitt requested a review from Viicos November 2, 2025 09:23
@davidhewitt davidhewitt merged commit 2e932c6 into main Nov 4, 2025
61 of 62 checks passed
@davidhewitt davidhewitt deleted the dh/infer-ip-addr branch November 4, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Serializing/Deserializing Built-in IP Address Types

3 participants