Repository navigation
Conversation
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.
192.168.0.0/24matches bothoneOfalternatives generated forIpNet, so the schema rejects a value produced by its own serializer. The IPv6 regex currently accepts a dotted IPv4 address without any colon.Require a colon in the IPv6 pattern in both schemars integrations. IPv4 values then match only the IPv4 branch, while compressed, full-width and IPv4-mapped IPv6 values continue to match the IPv6 branch. Fixes #74.
The regression uses an actual JSON Schema validator against serialized
IpNet,Ipv4NetandIpv6Netvalues, including wrong-family and invalid-prefix controls; both schemars versions fail against the original source. With the fix:cargo test --all-features: 37 unit tests, 2 schema regressions and 56 doctests pass.cargo test --no-default-features --features serde,schemars08and the correspondingserde,schemars1command: each passes 37 unit tests, its schema regression and 56 doctests.cargo build --all-features,cargo clippy --all-features --all-targets, focused test formatting andgit diff --checkpass. Clippy reports existing source warnings, also present on a clean-master control.The JSON Schema validator is a development-only dependency with network-resolution defaults disabled.