Skip to content

fix(tests): resolve FS0247 namespace/module conflict in v3 TypeMappingTests#334

Merged
sergey-tihon merged 2 commits intorepo-assist/test-v3-type-mapping-2026-03-20-3343483861bb6f23from
copilot/sub-pr-331
Mar 22, 2026
Merged

fix(tests): resolve FS0247 namespace/module conflict in v3 TypeMappingTests#334
sergey-tihon merged 2 commits intorepo-assist/test-v3-type-mapping-2026-03-20-3343483861bb6f23from
copilot/sub-pr-331

Conversation

Copy link
Contributor

Copilot AI commented Mar 22, 2026

Schema.Parser.Tests.fs declares module SwaggerProvider.Tests.v3 at the top level. The new Schema.TypeMappingTests.fs used module SwaggerProvider.Tests.v3.Schema.TypeMappingTests, causing F# to treat SwaggerProvider.Tests.v3 as a namespace in one file and a module in the other — triggering FS0247.

Change

Renamed the module declaration in Schema.TypeMappingTests.fs:

// Before — conflicts with `module SwaggerProvider.Tests.v3` in Schema.Parser.Tests.fs
module SwaggerProvider.Tests.v3.Schema.TypeMappingTests

// After — underscore avoids dot-extending the existing v3 module, consistent with v2 pattern
module SwaggerProvider.Tests.v3_Schema_TypeMappingTests

Follows the same convention already used in v2 tests (e.g. SwaggerProvider.Tests.v2.Schema_DefinitionsTests).


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

…conflict with Schema.Parser.Tests.fs

Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/c877bfb7-1289-4e88-8838-7ce910aca59c
Copilot AI changed the title [WIP] [Repo Assist] Test: add v3 DefinitionCompiler type-mapping unit tests fix(tests): resolve FS0247 namespace/module conflict in v3 TypeMappingTests Mar 22, 2026
Copilot AI requested a review from sergey-tihon March 22, 2026 15:48
@sergey-tihon sergey-tihon marked this pull request as ready for review March 22, 2026 15:53
Copilot AI review requested due to automatic review settings March 22, 2026 15:53
@sergey-tihon sergey-tihon merged commit c2066bc into repo-assist/test-v3-type-mapping-2026-03-20-3343483861bb6f23 Mar 22, 2026
@sergey-tihon sergey-tihon deleted the copilot/sub-pr-331 branch March 22, 2026 15:53
Copy link
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

Resolves an F# compiler error (FS0247) in the test suite by removing a namespace/module naming conflict between existing v3 parser tests and the newer v3 type-mapping tests.

Changes:

  • Renamed the top-level module in Schema.TypeMappingTests.fs to avoid treating SwaggerProvider.Tests.v3 as both a namespace and a module.

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

sergey-tihon added a commit that referenced this pull request Mar 22, 2026
…; drop unused FAKE imports (#331)

* test: add v3 DefinitionCompiler type-mapping unit tests; remove unused FAKE imports

Add 20 unit tests for the v3 DefinitionCompiler type mapping in a new
tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs.

Each test compiles a minimal inline OpenAPI 3.0 schema through the
DefinitionCompiler pipeline and asserts the resulting .NET property type:

- Primitives: bool, int32, int64, float32, double
- String formats: string, DateTimeOffset (date-time), DateTimeOffset (date),
  Guid (uuid), byte[*] (byte), IO.Stream (binary)
- Optional value-type wrapping: Option<bool>, Option<int32>, Option<int64>,
  Option<float32>, Option<double>, Option<DateTimeOffset>, Option<Guid>
- Optional reference-type passthrough: string and byte[*] remain unwrapped

Previously there were no unit tests covering the type-mapping logic inside
v3/DefinitionCompiler.fs; these tests make the mapping observable and will
catch regressions when the mapping changes (e.g. the DateOnly PR #321).

Also remove three unused FAKE package imports from build.fsx:
- Fake.DotNet.MSBuild  (no MSBuild-specific targets used)
- Fake.DotNet.FSFormatting  (fantomas is invoked via DotNet.exec, not FSFormatting.xxx)
- Fake.Api.GitHub  (GitHub release code is fully commented out in the Release target)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: trigger checks

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: formattin

* fix(tests): resolve FS0247 namespace/module conflict in v3 TypeMappingTests (#334)

* Initial plan

* fix FS0247: rename TypeMappingTests module to avoid namespace/module conflict with Schema.Parser.Tests.fs

Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/c877bfb7-1289-4e88-8838-7ce910aca59c

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Sergey Tihon <sergey.tihon@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants