Skip to content

Add AssertInRange, AssertNotNullOrWhiteSpace, and CheckNotNullOrEmpty to ArgumentDefinition#9794

Merged
jorgerangel-msft merged 4 commits intomainfrom
copilot/add-internal-helper-arguments
Feb 24, 2026
Merged

Add AssertInRange, AssertNotNullOrWhiteSpace, and CheckNotNullOrEmpty to ArgumentDefinition#9794
jorgerangel-msft merged 4 commits intomainfrom
copilot/add-internal-helper-arguments

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 24, 2026

  • Add BuildAssertNotNullOrWhiteSpace method to ArgumentDefinition.cs
  • Add BuildAssertInRange method to ArgumentDefinition.cs
  • Add BuildCheckNotNullOrEmpty method to ArgumentDefinition.cs
  • Update BuildMethods() to include the 3 new methods
  • Update generated TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/Argument.cs
  • Update docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Internal/Argument.cs
  • Add tests to ArgumentTests.cs (10 new tests, all passing)
  • Remove ThrowArgumentOutOfRangeException helper — inline Throw directly in BuildAssertInRange
  • Build and verify tests pass (17 ArgumentTests pass)
Original prompt

This section details on the original issue you should resolve

<issue_title>Add Additional Argument Internal Helper Methods</issue_title>
<issue_description>The .net autorest generator supported generated these internal helper methods, which are consumed by the .NET storage library:

We should update our generator to support generating these internal helper methods.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ArgumentDefinition

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Feb 24, 2026
Copilot AI changed the title [WIP] Add support for additional argument internal helper methods Add AssertInRange, AssertNotNullOrWhiteSpace, and CheckNotNullOrEmpty to ArgumentDefinition Feb 24, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9794
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client@9794
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client-csharp@9794

commit: fe338cd

…t in BuildAssertInRange

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@jorgerangel-msft jorgerangel-msft added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 6a2cd4c Feb 24, 2026
23 checks passed
@jorgerangel-msft jorgerangel-msft deleted the copilot/add-internal-helper-arguments branch February 24, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Additional Argument Internal Helper Methods

3 participants