Skip to content

Commit 398e8be

Browse files
committed
encoding/jsonschema: recognize date-time too
The Kubernetes documentation is inconsistent about whether the correct spelling is `datetime` or `date-time`. After digging into the code a bit, it seems that both forms are accepted (and also weird variants like `--date--time`, but we'll ignore that possibility). See this comment for some background [1]. [1] kubernetes/kubernetes#131082 (comment) Signed-off-by: Roger Peppe <[email protected]> Change-Id: Idcc5175536b1df3044e27d68c3c400713e711c0d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214780 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent 59e82a7 commit 398e8be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

encoding/jsonschema/constraints_format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var formatFuncs = sync.OnceValue(func() map[string]formatFuncInfo {
3939
"creditcard": {k8s, formatTODO},
4040
"data": {openAPI, formatTODO},
4141
"date": {vfrom(VersionDraft7) | openAPI | k8s, formatDate},
42-
"date-time": {allVersions | openAPI, formatDateTime},
42+
"date-time": {allVersions | openAPI | k8s, formatDateTime},
4343
"datetime": {k8s, formatDateTime},
4444
"double": {openAPI | k8s, formatTODO},
4545
"duration": {vfrom(VersionDraft2019_09) | k8s, formatTODO},

0 commit comments

Comments
 (0)