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

Fix http ports coerced schema #7

Open
marcossimoes opened this issue May 5, 2021 · 0 comments
Open

Fix http ports coerced schema #7

marcossimoes opened this issue May 5, 2021 · 0 comments

Comments

@marcossimoes
Copy link

Http ports should be allowed to be either the port number itself (integer) or a reference to a previously specified port number (string starting with a letter). Although the spec in the current schema is called int or string, the type is defaulting to a string. But passing the port number as a string is rejected by k8s api, as given a string it would expect it to start with a letter.

openapi v2 spec

curl -k https://staging-global-blue-kubernetes-api.nubank.com.br/openapi/v2 -H "Authorization: Bearer $(cat /tmp/token2)" | jq '.definitions["io.k8s.apimachinery.pkg.util.intstr.IntOrString"]'

{
  "description": "IntOrString is a type that can hold an int32 or a string.  When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type.  This allows you to have, for example, a JSON field that can accept a name or number.",
  "type": "string",
  "format": "int-or-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