-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
OpenAPI Spec file is invalid -- IntOrString
type
is a list
#4817
Comments
I think this can be closed since the project validates against Swagger 2.0 and using I was initially going to open a PR to fix this by changing this line in
But that results in this
Related reading: |
I think we should be maximally compatible with the spec. OpenAPI tools tend to be a bit out of date. @kennytrytek I think you have the correct place to fix this, but maybe it should just be: definitions["io.k8s.apimachinery.pkg.util.intstr.IntOrString"] = obj{"type": "string"} |
Wouldn't that break the |
It would be fine. That can be either an int or a string. String can be int, but int cannot be string. |
The unit tests agree that int cannot be a string:
Is the right solution to update the examples? Isn't this a breaking change for anyone using |
I'm not sure what the solution here is now. |
I'd suggest that the long-term solution is to use OpenAPI ≥ 3.1.0 since the discrepancy between the spec file and the json was rectified, and the short-term solution is to do nothing unless this out-of-spec swagger.json makes it harder to contribute to the project. |
FWIW I'm no longer working on the jsonnet lib that was mentioned and found a workaround for the issue if I ever did want to generate it again, so this issue is not interfering with that effort at all. It looks like kubernetes itself solves this by using https://github.com/kubernetes/apimachinery/blob/master/pkg/util/intstr/intstr.go#L128-L132 |
PR is open to revert back to only support |
type
is a list
type
is a listIntOrString
type
is a list
Per the OpenAPI Spec, the
type
field must not be a list as it only takes a single value. The correct way to specify multiple types is usingoneOf
andanyOf
.https://github.com/argoproj/argo/blob/4eaae251d9147b53604481237732bff36a16a91e/api/openapi-spec/swagger.json#L7994-L7997
This was found when I was attempting to generate a jsonnet lib from the OpenAPI spec.
The text was updated successfully, but these errors were encountered: