Skip to content

Commit

Permalink
Parse the items property on config type declarations
Browse files Browse the repository at this point in the history
When parsing a template, parse the `items` property on configuration type declarations.

Fixes #606
  • Loading branch information
julienp committed Aug 22, 2024
1 parent 88532b6 commit 3c3a700
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
- [features] add "pulumi.organiztion" to the built-in "pulumi" variable to obtain the current organization.

### Bug Fixes

- Parse the items property on config type declarations to prevent diagnostic messages about
unknown fields [#615](https://github.com/pulumi/pulumi-yaml/pull/615)
1 change: 1 addition & 0 deletions pkg/pulumiyaml/ast/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ type ConfigParamDecl struct {
Secret *BooleanExpr
Default Expr
Value Expr
Items *ConfigParamDecl
}

func (d *ConfigParamDecl) recordSyntax() *syntax.Node {
Expand Down
17 changes: 17 additions & 0 deletions pkg/pulumiyaml/ast/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ import (
const example = `
name: simple-yaml
runtime: yaml
config:
some-string-array:
type: array
value:
- subnet1
- subnet2
- subnet3
items:
type: string
some-nested-array:
type: array
items:
type: array
items:
type: string
some-boolean:
type: boolean
resources:
my-bucket:
type: aws:s3/bucket:Bucket
Expand Down

0 comments on commit 3c3a700

Please sign in to comment.