Skip to content

Incorrect "Required" Parameter in Documentation for Nullable Fields #317

@joergen98

Description

@joergen98

Description of the issue

Incorrect "Required" Parameter in Documentation for Nullable Fields

We have encountered an issue where a parameter that is defined as nullable in our templates is still marked as "required" in the generated documentation. Specifically:

  • When we define a parameter like param Instance string? in our Bicep files, it should be interpreted as nullable.

  • When compiled to an ARM template, the parameter appears as:

    "Instance": {
      "type": "string",
      "nullable": true
    }
    
    

Despite the parameter being nullable, the generated documentation incorrectly shows the parameter as Required: Yes (as seen in the attached screenshot).
Image

However, when the parameter is set like this:

param Instance string = ''

and in the corresponding JSON:

"Instance": { 
"type": "string",
"defaultValue": ""
}

the Required field in the generated documentation shows correctly as No.

This discrepancy between the actual parameter configuration and the generated documentation can cause confusion for users relying on the documentation for implementation. We would appreciate it if this could be investigated and resolved 😃

To Reproduce
The documentation is generated using the following command:

Invoke-PSDocument -Module PSDocs.Azure -OutputPath $templateName -InputObject $template -InstanceName $docName -Culture 'en-US'

Please let us know if further details are needed.

Module in use and version:

  • Module: PSDocs
  • Version: [v0.9.0]

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