mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
use title case for "Object" type
for backwards compatibility
This commit is contained in:
parent
ce3385ab1f
commit
61d408832a
@ -242,7 +242,9 @@ Takes dictionary as argument with keys:
|
|||||||
{{- $name := split $ref "/" | last -}}
|
{{- $name := split $ref "/" | last -}}
|
||||||
{{- or (split $name "." | last) "Object" -}}
|
{{- or (split $name "." | last) "Object" -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- or .type "Object" -}}
|
{{/* Old explain used capitalized "Object". Just follow suit */}}
|
||||||
|
{{- if eq .type "object" -}}Object
|
||||||
|
{{- else -}}{{- or .type "Object" -}}{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- fail "expected schema argument to subtemplate 'typeguess'" -}}
|
{{- fail "expected schema argument to subtemplate 'typeguess'" -}}
|
||||||
|
@ -310,6 +310,20 @@ func TestPlaintext(t *testing.T) {
|
|||||||
checkEquals("array"),
|
checkEquals("array"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// Shows that the typeguess puts Object tpye in title case
|
||||||
|
Name: "ArrayUnknown",
|
||||||
|
Subtemplate: "typeGuess",
|
||||||
|
Context: map[string]any{
|
||||||
|
"schema": map[string]any{
|
||||||
|
"description": "a cool field",
|
||||||
|
"type": "object",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Checks: []check{
|
||||||
|
checkEquals("Object"),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// Shows that the typeguess template works with scalars
|
// Shows that the typeguess template works with scalars
|
||||||
Name: "ArrayOfScalar",
|
Name: "ArrayOfScalar",
|
||||||
|
Loading…
Reference in New Issue
Block a user