mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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 -}}
|
||||
{{- or (split $name "." | last) "Object" -}}
|
||||
{{- else -}}
|
||||
{{- or .type "Object" -}}
|
||||
{{/* Old explain used capitalized "Object". Just follow suit */}}
|
||||
{{- if eq .type "object" -}}Object
|
||||
{{- else -}}{{- or .type "Object" -}}{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- fail "expected schema argument to subtemplate 'typeguess'" -}}
|
||||
|
@ -310,6 +310,20 @@ func TestPlaintext(t *testing.T) {
|
||||
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
|
||||
Name: "ArrayOfScalar",
|
||||
|
Loading…
Reference in New Issue
Block a user