Skip to content

[Repo Assist] test: extend DateOnly/TimeOnly type-mapping coverage (+7 tests, 317→324)#397

Merged
sergey-tihon merged 3 commits intomasterfrom
repo-assist/test-dateonly-type-mapping-20260422-823f17c6c6050f12
Apr 23, 2026
Merged

[Repo Assist] test: extend DateOnly/TimeOnly type-mapping coverage (+7 tests, 317→324)#397
sergey-tihon merged 3 commits intomasterfrom
repo-assist/test-dateonly-type-mapping-20260422-823f17c6c6050f12

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

Summary

Adds 7 type-mapping tests that were missing after PRs #393 and #394 introduced DateOnly/TimeOnly support. These tests exercise the full matrix of useDateOnly=true scenarios in DefinitionCompiler.

New tests

Test Expected type
required date + useDateOnly=true DateOnly
optional date + useDateOnly=true Option<DateOnly>
optional time + useDateOnly=true Option<TimeOnly>
PreferNullable + optional date + useDateOnly=true Nullable<DateOnly>
PreferNullable + required date + useDateOnly=true DateOnly (no wrapping)
PreferNullable + optional time + useDateOnly=true Nullable<TimeOnly>
PreferNullable + required time + useDateOnly=true TimeOnly (no wrapping)

Also exposes compilePropertyTypeWithNullableAndDateOnly helper in Schema.TestHelpers.fs for the provideNullable=true × useDateOnly=true combination.

Root cause of the gap

PR #394 (TimeOnly support) focused on the format: time path and its required/optional coverage, but did not add the corresponding DateOnly required test or the PreferNullable × useDateOnly variants.

Test Status

✅ All 324 unit tests pass (317 → 324, +7 new, 0 failed)

SwaggerProvider.Tests  Total: 324, Errors: 0, Failed: 0, Skipped: 1, Not Run: 0, Time: 0.947s

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

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Add the tests that were missing after PRs #393 and #394 landed:

* required date → DateOnly when useDateOnly=true
* optional date → Option<DateOnly> when useDateOnly=true
* optional time → Option<TimeOnly> when useDateOnly=true
* PreferNullable+useDateOnly: optional DateOnly → Nullable<DateOnly>
* PreferNullable+useDateOnly: required DateOnly stays unwrapped
* PreferNullable+useDateOnly: optional TimeOnly → Nullable<TimeOnly>
* PreferNullable+useDateOnly: required TimeOnly stays unwrapped

Also expose compilePropertyTypeWithNullableAndDateOnly helper in
Schema.TestHelpers for the PreferNullable×useDateOnly combination.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergey-tihon sergey-tihon marked this pull request as ready for review April 23, 2026 03:29
Copilot AI review requested due to automatic review settings April 23, 2026 03:29
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

Extends the SwaggerProvider test suite to cover the missing DateOnly/TimeOnly type-mapping cases introduced by recent useDateOnly support in DefinitionCompiler, including PreferNullable combinations.

Changes:

  • Add missing schema type-mapping tests for format: date/format: time when useDateOnly=true (required + optional).
  • Add PreferNullable=true × useDateOnly=true tests to ensure optional DateOnly/TimeOnly are wrapped as Nullable<T>.
  • Expose a new schema test helper to compile property types with both provideNullable=true and useDateOnly=true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/SwaggerProvider.Tests/Schema.TypeMappingTests.fs Adds 7 tests covering DateOnly/TimeOnly mapping and PreferNullable wrapping behavior under useDateOnly=true.
tests/SwaggerProvider.Tests/Schema.TestHelpers.fs Adds compilePropertyTypeWithNullableAndDateOnly helper to compile schemas with PreferNullable and useDateOnly enabled together.

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

Comment thread tests/SwaggerProvider.Tests/Schema.TypeMappingTests.fs
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • petstore.swagger.io
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet /usr/share/dotnet/sdk/10.0.201/FSharp/fsc.dll @/tmp/MSBuildTempMpoJGp/tmp1aa4c5ed8e10452eb4c14e5ee550a119.rsp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from sergey-tihon April 23, 2026 05:43
@sergey-tihon sergey-tihon merged commit dec1bdd into master Apr 23, 2026
1 of 2 checks passed
@sergey-tihon sergey-tihon deleted the repo-assist/test-dateonly-type-mapping-20260422-823f17c6c6050f12 branch April 23, 2026 05:43
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.

3 participants