Skip to content

Commit 8d843f4

Browse files
authored
Fix panic in code generator when generating lambda controller (#384)
The recent patch ([PR 383](#383)) introduced a regression that caused the code generator to panic when generating the lambda controller. This commit addresses the issue by adding a check to ensure that the shapeRef reference is not nil before accessing the Documentation field. This prevents the panic from occurring and allows the code generator to function correctly. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent e661ce9 commit 8d843f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/apis/crd.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
{{ .CRD.Documentation }}
1717
type {{ .CRD.Kind }}Spec struct {
1818
{{ range $fieldName, $field := .CRD.SpecFields }}
19-
{{ if $field.ShapeRef.Documentation -}}
19+
{{ if $field.ShapeRef -}}
2020
{{ $field.ShapeRef.Documentation }}
2121
{{ end -}}
2222
{{- if and ($field.IsRequired) (not $field.HasReference) -}}

0 commit comments

Comments
 (0)