{{/* Recursively process the "spec" portion of a CRD */}} {{/* Required parameters: - "key" representing the kind (yaml key) - "contents" representing all child yaml content of "key" - "page" is the current context (The . value) - "kind" is a hyphenated complete string of the kind, for example CompositeResourceDefinition-spec-claimNames-plural - "descDir" is the Hugo data object of all the remaining YAML to process. */}} {{/* identify the element for collapsables */}} {{ $elemID := (printf "%s-%s" .kind .key) }} {{/* make field access easier */}} {{ $contentFields := partial "apiBuilder/getSpecFields" .contents }} {{/* data types for styling */}} {{ $dataTypeStyle := $contentFields.dataTypeStyle }} {{ $dataType := $contentFields.dataType }} {{/* The inner "properties", if it exists */}} {{ $properties := $contentFields.properties }} {{/* Is this field an enum? */}} {{ $enum := false }} {{ partial "apiBuilder/specCollapseButtonStart" (dict "elemID" $elemID "key" .key) }} {{/* Check if the type is `enum` or `oneOf`/`allOf` */}} {{ $isEnum := partial "apiBuilder/isEnum" .contents }} {{/* Print the correct data type tag */}} {{ if $isEnum }} {{/* enum fields handle "oneOf" type data lists */}} {{ partial "apiBuilder/enumHandler" .contents }} {{ else }} {{ $dataType }} {{ end }} {{/* Add the "Required" tag if necessary */}} {{if .required }} required {{ end }} {{ partial "apiBuilder/specCollapseButtonEnd" (dict "elemID" $elemID "page" .page) }} {{/* The container to show/hide with information related to the CRD */}}