Skip to content

[Repo Assist] eng: remove stale YamlDotNet dependency + test coverage for cookie params, text/plain and default responses#386

Merged
sergey-tihon merged 2 commits intomasterfrom
repo-assist/eng-remove-yamldotnet-20260417-cf83c8c2c38f1d97
Apr 18, 2026
Merged

[Repo Assist] eng: remove stale YamlDotNet dependency + test coverage for cookie params, text/plain and default responses#386
sergey-tihon merged 2 commits intomasterfrom
repo-assist/eng-remove-yamldotnet-20260417-cf83c8c2c38f1d97

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Two related code-quality improvements bundled together:

1. Remove stale YamlDotNet dependency

YamlDotNet was only used by the old v2 custom YAML parser. That parser was removed in PR #377. The paket.dependencies file even had an explicit comment:

# delete when we drop custom parser for v2
nuget YamlDotNet

This PR finally honours that comment. YAML document parsing continues to work via Microsoft.OpenApi.YamlReader (which uses SharpYaml internally) — no functionality is lost.

Changes:

  • Remove nuget YamlDotNet (and its TODO comment) from paket.dependencies
  • Remove YamlDotNet from src/SwaggerProvider.DesignTime/paket.references
  • paket.lock is updated accordingly

As a side-effect, dotnet paket install also picked up newer commits of the GitHub-sourced FSharp.TypeProviders.SDK and FSharp.Data dependencies.

2. Add test coverage for three untested OperationCompiler code paths

The OperationCompiler handles cookie parameters, text/plain responses, and default response codes, but none of these paths had unit tests. Six new tests are added:

Scenario Tests added
Cookie parameters required cookie is non-optional; optional cookie is optional; both appear as method params
text/plain response produces Task<string> (task mode) and Async<string> (async mode)
default response as only success code return type is resolved from the default entry

Test count: 281 → 287.

Test Status

✅ Build: 0 errors, 211 warnings (all pre-existing)
✅ Unit tests: 287 passed, 0 failed, 1 skipped

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

github-actions bot and others added 2 commits April 17, 2026 22:13
YamlDotNet was only used by the old v2 custom parser which was removed
in PR #377. The paket.dependencies comment already said to delete it
when the v2 parser was dropped. Microsoft.OpenApi.YamlReader (which
uses SharpYaml internally) continues to handle YAML document parsing.

All 281 unit tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s (+6)

Add unit tests for three previously untested OperationCompiler code paths:

- Cookie parameters: verify that cookie params appear as method params,
  required cookies are non-optional, optional cookies are optional.
- text/plain response: verify that an operation returning text/plain
  produces Task<string> (and Async<string> in async mode).
- default response: verify that when no 2xx response is defined, the
  'default' response is used to determine the return type.

Total test count: 281 → 287.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergey-tihon sergey-tihon marked this pull request as ready for review April 18, 2026 05:20
Copilot AI review requested due to automatic review settings April 18, 2026 05:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes an unused YAML parsing dependency (left over from the removed v2 custom parser) and adds unit tests to cover previously untested OperationCompiler behaviors, strengthening confidence in the OpenAPI v3 compilation pipeline.

Changes:

  • Drop the direct YamlDotNet Paket dependency and reference entries now that YAML parsing is handled via Microsoft.OpenApi.YamlReader.
  • Update paket.lock accordingly (including updated GitHub-pinned commits for FSharp.TypeProviders.SDK and FSharp.Data files).
  • Add new unit tests covering cookie parameters, text/plain responses, and default-only success responses.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
tests/SwaggerProvider.Tests/Schema.OperationCompilationTests.fs Adds unit tests for cookie params, text/plain return typing, and default response return typing.
src/SwaggerProvider.DesignTime/paket.references Removes the stale YamlDotNet reference from the DesignTime project.
paket.dependencies Removes the stale YamlDotNet dependency entry (and its TODO comment).
paket.lock Removes YamlDotNet from the resolved graph and updates pinned GitHub dependency commits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergey-tihon sergey-tihon reopened this Apr 18, 2026
@sergey-tihon sergey-tihon merged commit 7b25fdf into master Apr 18, 2026
13 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants