Azure / Azure/autorest.powershell

Show enum/known values in documentation

Open
#451 2 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Since an enums values are known, these values should be displayed in the documentation when the enum is a parameter. These situations would allow this feature to work:
- The parameter is an `enum`
- The parameter has a [ValidateSet](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/validateset-attribute-declaration) attribute on it
- The parameter is the 'string enum' type we use for REST APIs (getting those via reflection seen [here](https://github.com/Azure/autorest.powershell/blob/06401f99f93406125978f41d455e8aaf2d8a6c18/extensions/powershell/resources/runtime/BuildTime/Cmdlets/ExportModelSurface.cs#L91-L94))

These values would be shown in:
- Markdown documentation as `Accepted values` for the parameter descriptions (as seen for Option and Scope in [this cmdlet](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/set-alias?view=powershell-6#parameters))
- Markdown documentation in the Syntax section as `{ }` described [here](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_syntax?view=powershell-6#symbols-in-syntax-diagrams)
- Note that means it no longer shows the type of the parameter in this syntax. Meaning `[-Option ]` becomes `[-Option {First | Second | Third}]`.
- Complex type documentation in the exports and markdown

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.