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

Shouldn't have to rewrite param default value in order to add more attributes #450

Closed
StephenWeatherford opened this issue Sep 4, 2020 · 2 comments
Labels
revisit syntax Related to language syntax

Comments

@StephenWeatherford
Copy link
Contributor

If you create a param with a default value:

param myparam string = 'my default'

and then later you need to add min/max, you shouldn't have to rewrite the default portion in order to do it:

param storageAccountName string {
  default: 'my default'
  minLength: 3
  maxLength: 24
}

Why not just allow this?

param storageAccountName string = 'my default' {
  minLength: 3
  maxLength: 24
}
@ghost ghost added the Needs: Triage 🔍 label Sep 4, 2020
@alex-frankel alex-frankel added syntax Related to language syntax and removed Needs: Triage 🔍 labels Sep 9, 2020
@alex-frankel
Copy link
Collaborator

We are likely going to switch parameter modifiers to a decorator syntax at which point you should be able to do this. Take a look at #64

@alex-frankel
Copy link
Collaborator

The new decorator syntax has been merged, so you can try the nightly, but it has not yet been released. The new syntax is:

@minLength(3)
@maxLength(24)
param storageAccountName string = 'my default'

@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
revisit syntax Related to language syntax
Projects
None yet
Development

No branches or pull requests

2 participants