Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined types - sealed decorator not working in bicep parameters files #11981

Closed
slavizh opened this issue Sep 29, 2023 · 1 comment · Fixed by #11985
Closed

User defined types - sealed decorator not working in bicep parameters files #11981

slavizh opened this issue Sep 29, 2023 · 1 comment · Fixed by #11985
Assignees
Labels
bug Something isn't working story: bicep parameters
Milestone

Comments

@slavizh
Copy link
Contributor

slavizh commented Sep 29, 2023

Bicep version
Bicep CLI version 0.21.1 (d4acbd2)

Describe the bug
If I understand correctly the sealed decorator when you have it on an object if you define property in bicep parameters files that is not defined in the type of that object the deployment will fail as it will not allow you to pass any properties that are not defined in the type. But shouldn't bicep parameters file signal that as an issue before deployment (in VSC UI)?

To Reproduce
Steps to reproduce the behavior:

Additional context
Add any other context about the problem here.

@jeskew
Copy link
Contributor

jeskew commented Sep 29, 2023

Looks like parameter assignment statements in .bicepparam files are only performing a shallow type check. I'll open a PR to update that check to validate object properties as well.

@jeskew jeskew self-assigned this Sep 29, 2023
@jeskew jeskew added this to the v0.22 milestone Sep 29, 2023
@jeskew jeskew added bug Something isn't working and removed Needs: Triage 🔍 labels Sep 29, 2023
jeskew added a commit that referenced this issue Oct 1, 2023
… files (#11985)

Resolves #11981 

Type analysis in `.bicepparam` files is currently only performing an
assignability (shallow type affinity) check. This PR updates that
analysis to use the `TypeValidator`'s deep validation method to match
how parameter default values and resource bodies are checked.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/11985)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working story: bicep parameters
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants