Skip to content

input matches more than one oneOf schemas when trying to validate IPv4 or IPv6 addresses #430

@thediveo

Description

@thediveo

Given this schema definition snippet for validating a string to be either a correct IPv4 or IPv6 textual representation:

        IPvX-Address:
            description: |-
                Represents either an IPv4 or IPv6 address (without prefix or any
                associated lifetimes, et cetera)
            type: string
            oneOf:
                - type: string
                  format: ipv4
                - type: string
                  format: ipv6

and using github.com/getkin/kin-openapi v0.76.0 I end up with for a value, such as Value: <string>"127.0.1.1" with this validation errorr: input matches more than one oneOf schemas.

Am I defining IPvX-Address wrong or is this an issue with kin-openapi v0.76.0?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions