Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dasionov opened this issue Dec 17, 2024 · 0 comments

Comments

@dasionov
Copy link

dasionov commented Dec 17, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant