Skip to content

Incorrect Type Validation for spec Field: Interprets Numeric Field as String #191

Closed
@dasionov

Description

@dasionov

Description:

When validating OpenAPI schemas using the github.com/go-openapi/validate v0.20.2 package, a numeric field within a nested structure incorrectly fails validation when its type is specified to be any of string or integer.

when I try to set:

spec:
  domain:
    memory:
      guest: 2312241152

Error Example:

[spec.template.spec.domain.memory.guest in body must be of type string: "number"]

of course it works fine with

spec:
  domain:
    memory:
      guest: "2312241152"

the schema in the crd:

guest:
  anyOf:
  - type: integer
  - type: string

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions