-
Notifications
You must be signed in to change notification settings - Fork 756
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
Inconsistency of type int
allowing null
in some scenarios, but not other
#5938
Comments
We may need to introduce null-able types |
Faced similar issue with one of the property (defaultTtl) for CosmosDB The docs says we can set the property to null but using bicep it throws an error (One of the specified inputs is invalid) Bicep Version: Bicep CLI version 0.4.1008 (223b8d2)
any plan to support this? or do we have any workaround? as there are multiple integer type of properties which we want to set as per their own conditions |
@rushirg - I am not able to repro this with v0.4.1272. Can you double check that you are hitting this with the latest version? |
Yes, hitting the same with Bicep CLI version 0.4.1272 (a69022d)
the only way I found to set the "Time to Live" off is by removing the property "defaultTtl" from the resource |
+1 for this issue, there's no straightforward way to disable defaultTtl other than conditionally remove that property. Removing that property needs hacking as well. I'm seeing this issue using ARM template as well. |
Also hitting this when making a template for sql database. We want to include a param that is only used for serverless databases but this results in @description('Minimum scaling for serverless databases. Minimum value is 1/8th of # of VCores of serverless tier. Use json(\'0.5\') syntax for decimal numbers.')
param minCapacity int = null |
Just to pile a +1 on to this. It was a gigantic pain to figure out how to work around this for conditionally setting a Just in case anybody else is running into this, I ended up having to do something like this:
The actual fix ended up being pretty straightforward, but figuring out the magic syntax turned out to be incredibly challenging. It also didn't help that |
Bicep version
VSCode v0.4.1124
Describe the bug
The bicep language seems somewhat inconsistent as to whether it allows null. In the below example, both scenarios describe a value of type
int
, however one allows null, and one doesn't.Assuming this is the desired behaviour
capacityReservationLevel
should show the type asint?
orint | null
)To Reproduce
capacityReservationLevel
is described as typeint
and allowsnull
However if you have a parameter of type
int
, then null isn't allowedThe text was updated successfully, but these errors were encountered: