Azure / Azure/PSDocs.Azure

BUG - Parameter required on nullable types

Open
#340 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
67
Forks
27
PR merge metrics
No merged PRs in 30d

Description

## **Description of the issue**

[Nullable datatypes](https://github.com/Azure/bicep/pull/9454) 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:
```bicep
@description('Optional. List of application security groups to deploy.')
param applicationSecurityGroups string[]?
```

Builds to json like this:
```json
"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](https://img.shields.io/badge/parameter-required-orange?style=flat-square)

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`:

```text
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.