Skip to content

Property of UDT defined as any type cannot be marked as nullable/optional #18878

@jan-delaet

Description

@jan-delaet

Bicep version
Bicep CLI version 0.39.26 (1e90b06)

Describe the bug
When defining a user-defined type in Bicep and having one of its properties have the "any" type, adding a "?" at the end to mark it as nullable/optional does not seem to do anything. When referencing this UDT for a parameter and providing a value for this parameter, the language server continues to see it as a required property.

To Reproduce
This behaviour can be easily seen as such:

type udtWithAnyType = {
  name: string
  description: string?
  value: any?
}

param myParam udtWithAnyType
Image

Additional context
Another weird behaviour is that it also does not work properly for validating if a property with "any" is actually required, as shown in the screenshot provided below.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: UpvoteThis issue requires more votes to be considered

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions