json-schema-org / json-schema-spec

The JSON Schema specification
http://json-schema.org/
Other
3.43k stars 251 forks source link

String format validation for IP addresses with network mask #1501

Closed shodhansave closed 2 weeks ago

shodhansave commented 3 months ago

Hello folks,

I came across string validation format for IP addresses. I was wondering if we can support the addresses with network mask as well. That means validating something like 192.168.10.0/31.

This can be achieved using regexp, but I'm curious to know if this validation can be part of the spec.

Thanks

gregsdennis commented 2 weeks ago

@shodhansave the format keyword is open-ended and not validated by default, so you're welcome to make any format you want.

I'm not sure that this specific format warrants inclusion in the spec, though. Happy to be proven wrong if you can prove the demand for it.

Closing this for now.