GREsau / schemars

Generate JSON Schema documents from Rust code
https://graham.cool/schemars/
MIT License
820 stars 227 forks source link

Fix schema for IpAddr type #277

Open Soneji opened 7 months ago

Soneji commented 7 months ago

The IpAddr type returns

"format": "ip"

which isn't a valid JSON format type. See here for the correct implementation.

I have changed this type to instead use

"anyOf": [
  {
    "type": "string",
    "format": "ipv4"
  },
  {
    "type": "string",
    "format": "ipv6"
  }
]