-
Notifications
You must be signed in to change notification settings - Fork 60
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
Pass natural/integer preference args to openapi-to-dhall #178
Pass natural/integer preference args to openapi-to-dhall #178
Conversation
pass natural/integer preference args to openapi-to-dhall based on version being generated.
2917fb4
to
46cb9db
Compare
I've now completed the implementation to utilize the functionality now upstream in |
@arobertn: Thank you for doing this! |
Always good to learn something by doing. Any ideas when the next release will happen? |
Generated Kubernetes manifests looks wrong.
Same issue with other fields
Default mode should be integer, not a float value. |
@uthark: Are you using |
This PR addresses #177 by passing the
--preferNaturalInt
argument toopenapi-to-dhall
(under PR dhall-lang/dhall-haskell#2316) and including a list of exceptions that should actually be rendered as Dhall Integer.The list is set based on the version in
nix/nixpkgs.nix.make-dhall-kubernetes()
, determined by going through the fields in the kubernetes openapi spec files manually. It turns out that there have been no major additions / removals of such fields that should be Integers within current range of versions 1.12 - 1.22, so the list is the same for all. (If a new Kubernetes version is added and a new entry is not added here, an empty argument will be passed todhall-openapi
which will trigger a build failure.)The preferred solution in #177 that the Kubernetes project includes integer ranges in their Swagger specs is in-process (kubernetes/kubernetes#105533), but this will solve the issue in the meantime, and is isolated and easily reverted when that comes.