🐛 Add format for float types#566
Conversation
Signed-off-by: Tamal Saha <tamal@appscode.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tamalsaha The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
|
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
|
/remove-lifecycle rotten |
|
Relevant issue is #245 and it doesn't seem clear if we should allow this or not. The kube api conventions excplicitly mention not to allow floats in spec: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#primitive-types /hold |
|
@alvaroaleman possibly worth seeing discussion on #449 for history. |
| case types.Float32: | ||
| format = "float" | ||
| case types.Float64, types.UntypedFloat: | ||
| format = "double" |
There was a problem hiding this comment.
Hi @tamalsaha,
That is nice. But did you check the comment on top of this method? See:
// builtinToType converts builtin basic types to their equivalent JSON schema form.
// It *only* handles types allowed by the kubernetes API standards. Floats are not
// allowed unless allowDangerousTypes is true
In this way, I understand that we cannot add the floats here.
Signed-off-by: Tamal Saha tamal@appscode.com
https://swagger.io/docs/specification/data-models/data-types/#numbers