[Repo Assist] test: extend OperationCompiler unit tests (+12 tests)#380
Merged
sergey-tihon merged 3 commits intomasterfrom Apr 15, 2026
Conversation
Add unit tests for three previously uncovered code paths: - asAsync=true mode: verify Async<T> return types are emitted instead of Task<T> for all operation shapes - DELETE/PUT operations: verify generated method names, parameter ordering, and return types (Task<unit> for 204, Task<T> for JSON response body) - Header parameters: verify required header params are included as non-optional method parameters and are camelCased Total: 268 → 280 tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Extends Schema.OperationCompilationTests.fs with additional unit tests to cover previously untested OperationCompiler behaviors, including async (asAsync=true) return types, additional HTTP methods, and header-parameter handling.
Changes:
- Add helper to compile schemas with
asAsync=trueand new assertions forAsync<'T>return types. - Add DELETE and PUT operation compilation tests (method generation, parameter ordering, return type resolution).
- Add header-parameter compilation tests (inclusion, camelCasing, required vs optional).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
@copilot format, fix build and address inline commnets |
Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/4c2ffc84-8bec-4cf4-8049-ed8904bb8825 Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Contributor
Done in e0bbd63. I fixed the inline review issue by updating the section header to match actual coverage ( |
8 tasks
github-actions Bot
added a commit
that referenced
this pull request
Apr 18, 2026
Capture the 9 PRs merged since beta01 (April 14 – April 18): - fix: preserve properties+additionalProperties (#383) - refactor: CallAsync returns HttpResponseMessage (#385) - eng: remove stale YamlDotNet dependency (#386) - test: +18 OperationCompiler tests (#380, #386) - docs: README and VitePress site updates (#379, #382) - ci: Dependabot action bumps (#387-#390) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sergey-tihon
pushed a commit
that referenced
this pull request
Apr 19, 2026
* docs: add 4.0.0-beta02 release notes entry Capture the 9 PRs merged since beta01 (April 14 – April 18): - fix: preserve properties+additionalProperties (#383) - refactor: CallAsync returns HttpResponseMessage (#385) - eng: remove stale YamlDotNet dependency (#386) - test: +18 OperationCompiler tests (#380, #386) - docs: README and VitePress site updates (#379, #382) - ci: Dependabot action bumps (#387-#390) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger checks --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Extends
Schema.OperationCompilationTests.fswith 12 new unit tests covering three previously untested code paths inOperationCompiler.Test count: 268 → 280
New Coverage
asAsync=truemode (4 tests)The
OperationCompilerhas aasAsync: boolconstructor parameter that switches return types fromTask<T>toAsync<T>. Before this PR there were zero unit tests exercising this path.GETreturning JSON string →Async<string>notTask<string>POSTwith no body →Async<unit>notTask<unit>CancellationTokenis still injected last in async modeDELETE / PUT operations (6 tests)
The existing tests only covered
GETandPOST. Added coverage for:Task<unit>on 204, path param orderingTask<T>return when JSON responseHeader parameters (2 tests)
X-Api-Version→xApiVersion)IsOptional = false)Test Status
Formatting validated with Fantomas.