java-generator doesn't handle all integer formats
Mawi137 opened this issue · comments
Is your enhancement related to a problem? Please describe
Since version 6.9.0 there is an extra check on the integer formats, but only int32 and int64 are covered. We are using uint and uint64 in our CRDs and are unable to update the java-generator because of this limitation.
Describe the solution you'd like
Can support for uint, unit8 ... uint64 be added to the format check?
Describe alternatives you've considered
No response
Additional context
No response
Hi @Mawi137 and thanks for your interest in the project!
According to the documentation uint
is not a supported format.
That said, from the OpenAPI spec:
An optional format modifier serves as a hint
more specifically:
However, format is an open value, so you can use any formats, even not those defined by the OpenAPI Specification
So I overall agree with relaxing the check.
We should remove this exception and fallback to the same as format == null
.
Nice to have: produce a warning in these situations.
Would you like to send a PR with the changes?
Hi
Thanks for your quick reply!
Our CRDs are generated from Rust code which allows unsigned integers. However, it makes more sense to follow the Kubernetes spec. So thanks for pointing out that only int32 and int64 are supported. We'll adapt it on our side.