Skip to content

BUG - Parameter required on nullable types #340

@picccard

Description

@picccard

Description of the issue

Nullable datatypes in bicep compiles to json with the nullable-property as true, but the docs will say the parameter is required and not optional. The module should be report optional if property defaultValue is not empty or if this property nullable is true.

To reproduce

Bicep code like this:

@description('Optional. List of application security groups to deploy.')
param applicationSecurityGroups string[]?

Builds to json like this:

"applicationSecurityGroups": {
  "type": "array",
  "items": {
    "type": "string"
  },
  "nullable": true,
  "metadata": {
    "description": "Optional. List of application security groups to deploy."
  }
}

Results in doc like this:

applicationSecurityGroups

Parameter Setting

Optional. List of application security groups to deploy.

Expected behaviour

![Parameter Setting] should be set as optional if the parameter-property nullable is true.

Module in use and version:

  • Module: PSDocs.Azure
  • Version: [0.3.0]

Captured output from $PSVersionTable:

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-100…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions