Remove nullable from typename for inputs and outputs #753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request introduces enhancements to handle nullable types more effectively in type names and includes corresponding updates to tests. The key changes involve adjustments to type name processing logic and the addition of test cases to validate the new behavior.
Improvements to nullable type handling:
src/Transform/TransformBase.cs
: Updated theGetAdjustedTypename
method to unwrap nullable types usingNullable.GetUnderlyingType
, ensuring that type names are simplified correctly.src/Transform/TransformBase.cs
: Enhanced theFixUpTypeName
method to handle generic nullable types by removing backticks and type arguments, further improving the readability of type names.Test updates for nullable type handling:
test/Pester/ConvertToCommandHelp.Tests.ps1
: Added a new helper function,Test-InputOutputTypes
, to test input and output type handling for nullable types.test/Pester/ConvertToCommandHelp.Tests.ps1
: Introduced a test case to verify that nullable types are correctly processed and do not include "Nullable" in the input type name.PR Context
Fixes #545