Skip to content

IPv6 address matching IPv4 schema #969

@silverwind

Description

@silverwind

Given a openapi spec containing the following schema:

type: string
oneOf:
  - format: ipv4
  - format: ipv6
example: "2001:db8::"

Running the validate command against it yields this error:

invalid example: input matches more than one oneOf schemas

The error seems to indicate a bug in the ipv4 format because the IPv6 address should only match ipv6 format, not ipv4.

On a side note, it'll be better to change this to anyOf in any case because IPv4 addresses can be contained in IPv6 addresses, but not the other way around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions