json-schema-org / json-schema-org/JSON-Schema-Test-Suite
Add test to ensure dotted-decimal IPv4 addresses are rejected by format: hostname
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 750
- Forks
- 307
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 24
Description
The current format-hostname test suite does not include a case ensuring that dotted-decimal IPv4 addresses (e.g., 192.168.0.1) are rejected.
Because hostname labels are allowed to:
- start with digits, and
- be entirely numeric,
a validator may incorrectly validate 192.168.0.1 as four numeric labels and accept it as a hostname.
However, RFC 1123 section2.1 mentioned in the spec states:
a valid host name can never have the dotted-decimal form #.#.#.#
Therefore, dotted-decimal IPv4 addresses must not be considered valid hostnames.
Since we already provide a separate format: ipv4, allowing such values to pass hostname would blur the distinction between the two formats.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/draft2020-12/optional/format/hostname.json, the existing format-hostname test suite. Add a dotted-decimal IPv4 example such as 192.168.0.1 to the rejected cases, and confirm the suite clearly distinguishes hostname validation from the separate ipv4 format.
Written by the indexing model from the issue text.
Assessment
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100