Skip to content

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

Merged
achanda merged 2 commits into
achanda:masterfrom
ahl:fail
Jun 29, 2022
Merged

achanda merged 2 commits into
achanda:masterfrom
ahl:fail

Conversation

@ahl

@ahl ahl commented Jun 27, 2022

Copy link
Copy Markdown
Contributor

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

achanda commented Jun 29, 2022

Copy link
Copy Markdown
Owner

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