Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Updates JSON Schema generation to correctly model net.IP values as accepting both IPv4 and IPv6, aligning the emitted schema with net.IP.UnmarshalText / net.ParseIP.
Changes:
- Emit
anyOfwith"format": "ipv4"and"format": "ipv6"fornet.IP. - Add a regression test covering
net.IPschema generation. - Update schema fixtures to match the new
net.IPoutput.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| reflect.go | Switch net.IP schema from IPv4-only to anyOf (IPv4/IPv6). |
| reflect_test.go | Add regression test for net.IP schema output. |
| fixtures/test_user.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/test_user_assign_anchor.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/required_from_jsontags.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/no_reference.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/no_reference_anchor.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/ignore_type.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/defaults_expanded_toplevel.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
| fixtures/custom_additional.json | Update ip_addr to anyOf IPv4/IPv6. |
| fixtures/allow_additional_props.json | Update network_address to anyOf IPv4/IPv6 (plus fixture reformat/reordering). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #198
net.IP uses ParseIP so ipv6 is valid.
schema was ipv4 only.
emit anyOf ipv4/ipv6. test + fixtures.