Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct and validate JsonSchema for Ipv4Network, Ipv6Network, and IpNetwork #157

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

ahl
Copy link
Contributor

@ahl ahl commented Jun 27, 2022

Fixes #156

This corrects the JsonSchema impl for Ipv4Network, Ipv6Network, and IpNetwork. It uses the does-it-json crate to validate that the schemas and serialization match. There's a little bit of extra niceness in the schemas:

  • They specify the x-rust-type extension so that code generators can substitute in the ipnetwork::*
  • IpNetwork includes labels for the two oneOf schema variants in order to let code generators produce nicer code

Neither of these is strictly necessary. I can remove them if desired, but I think they add an extra degree of polish

@achanda
Copy link
Owner

achanda commented Jun 29, 2022

Looks great to me, thanks @ahl 🙏

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.

JSON schema for IpNetwork does not match its serialized form
2 participants