Comments (4)
@Speeddymon this would be done by adding new formats - we can't change existing formats (some of which are specified by JSON Schema and not OpenAPI) as that will break existing users who would consider accepitng a CIDR or netmask for format: ipv4
to be an error. So we'd add more formats. This can be done by opening a PR on the format registry, which lives on the gh-pages
branch in this repository.
Typically we'd add a format for each thing, and then you would use anyOf
or oneOf
to say that something could be either an address or a netmask, etc.
from openapi-specification.
Upon re-reading with that context, this makes sense. I'll submit a PR for consideration, thank you!
from openapi-specification.
Thanks @handrews.
I have taken a look at the gh-pages
branch in registries/_format/ipv4.md
and followed the link to the JSONSchema definition:
An IPv4 address according to the "dotted-quad" ABNF syntax as defined in RFC 2673, section 3.2 [RFC2673].
Following the link to RFC2673 section 3.2 (direct link to the relevant section here) states:
A Bit-String Label is represented in text -- in a zone file, for
example -- as a surrounded by the delimiters "[" and "]".
The is either a dotted quad or a base indicator and a
sequence of digits appropriate to that base, optionally followed by a
slash and a length. The base indicators are "b", "o" and "x",
denoting base 2, 8 and 16 respectively. The length counts the
significant bits and MUST be between 1 and 32, inclusive, after a
dotted quad, or between 1 and 256, inclusive, after one of the other
forms. If the length is omitted, the implicit length is 32 for a
dotted quad or 1, 3 or 4 times the number of binary, octal or
hexadecimal digits supplied, respectively, for the other forms.
So, is jsonschema wrong in not supporting the optional slash and length indicator? Should I open an issue upstream before considering to submit a new format here?
from openapi-specification.
@Speeddymon the key part of the text there is according to the "dotted-quad" ABNF syntax
What that means is that only this part of the ABNF (the "dotted-quad" production and its dependency, "decbyte") is relevant.
dotted-quad = decbyte "." decbyte "." decbyte "." decbyte
decbyte = 1*3DIGIT
So no, jsonschema is not wrong.
If you want a format that corresponds to the "bit-string-label" production, that would be a separate format from the existing IP v4 format.
from openapi-specification.
Related Issues (20)
- Schema development: main or branch, in parallel or at release time?
- Should we-organize our GitHub pages to a directory on main?
- Why does the JSON schema for 3.0 specify patternProperties for component names but allows additional properties?
- Support for `multipart/mixed` (and possibly better `multipart/*` support in general) HOT 11
- `description`/`summary` for Paths Object
- Support `multipart/byteranges` for 206 responses
- Support application/json-seq and similar JSON-based sequential formats HOT 1
- Did we break 3.2 compatibility by removing the Path Item $ref special case? HOT 12
- pipeDelimited and spaceDelimited style examples can be unresolvable HOT 10
- Encoding Object `contentType` field: "comma-separated list of the two types"? HOT 8
- Add appendix "Informative references" to published spec documents HOT 4
- Open Community (TDC) Meeting, Thursday 02 May 2024 HOT 3
- How are conflicts between `allowReserved` and RFC 3986 handled? HOT 6
- "body parameter" example in 3.x does not fit how Request Body Objects work HOT 6
- Open Community (TDC) Meeting, Thursday 09 May 2024 HOT 2
- Establish governance docs for working groups
- Codify the meaning of "undefined" and "implementation-defined" HOT 3
- Use URI references for Security Requirements in 3.2
- remove "Optional OAuth2 security" examples HOT 2
- Style guide / release checklist for the specification HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-specification.