Skip to content

[repo-assist] test: integer enum, $ref-to-enum, v2 allOf collapse, v2 string enum (+9 tests, 459→468)#449

Merged
sergey-tihon merged 3 commits into
masterfrom
repo-assist/test-schema-compilation-20260523-6d35769476499c5a
May 23, 2026
Merged

[repo-assist] test: integer enum, $ref-to-enum, v2 allOf collapse, v2 string enum (+9 tests, 459→468)#449
sergey-tihon merged 3 commits into
masterfrom
repo-assist/test-schema-compilation-20260523-6d35769476499c5a

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

Summary

Expands the schema compilation test suite with 9 new tests covering previously untested compilation behaviours (+9 tests, 459 → 468).

New V3 tests (Schema.V3SchemaCompilationTests.fs)

Integer enum compilation

  • integer enum schema compiles to a named enum type — top-level type: integer + enum emits a named ProvidedTypeDefinition
  • integer enum type is an enumIsEnum = true
  • integer enum has the correct number of members — literal field count matches the enum values

$ref to enum type

  • required property referencing a string enum uses the named enum type — a required property using $ref to a string enum schema resolves to the enum type, not obj
  • required property referencing a string enum is not wrapped in option — required enum $ref is not wrapped in Option<T> or Nullable<T>

New V2 tests (Schema.V2SchemaCompilationTests.fs)

allOf single $ref collapse

  • v2 allOf single ref collapses to the referenced type — parallel to the existing V3 test; a Swagger 2.0 definition using allOf: [$ref] with no own properties collapses
  • v2 allOf single ref does not produce a separate wrapper type — no separate wrapper type emitted

Top-level string enum

  • v2 top-level string enum compiles to a named enum type — a definitions entry with type: string + enum emits a named provided type
  • v2 top-level string enum type is an enumIsEnum = true

Test Status

dotnet build  →  0 errors, 12 warnings (pre-existing)
dotnet run tests  →  Total: 468, Errors: 0, Failed: 0, Skipped: 1 ✅

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

To install this agentic workflow, run

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

…+9 tests, 459→468)

- V3: integer enum compiles to named IsEnum type with correct member count
- V3: required property referencing a string enum uses enum type directly
- V2: allOf with single $ref collapses (no wrapper type emitted)
- V2: top-level string enum compiles to named IsEnum type

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

Expands the Swagger/OpenAPI schema compilation test suite to cover additional enum and $ref/allOf compilation behaviors for both OpenAPI v3 and Swagger v2, helping prevent regressions in DefinitionCompiler/OperationCompiler.

Changes:

  • Add OpenAPI v3 tests for top-level integer enum compilation and required $ref-to-enum property typing.
  • Add Swagger v2 tests for allOf: [$ref] collapse behavior and top-level string enum compilation.
  • Increase total test count from 459 to 468.

Reviewed changes

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

File Description
tests/SwaggerProvider.Tests/Schema.V3SchemaCompilationTests.fs Adds v3 schema compilation tests for integer enums and $ref to named enum properties.
tests/SwaggerProvider.Tests/Schema.V2SchemaCompilationTests.fs Adds v2 schema compilation tests for allOf single-ref collapse and top-level string enums.

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

Comment thread tests/SwaggerProvider.Tests/Schema.V3SchemaCompilationTests.fs Outdated
Comment thread tests/SwaggerProvider.Tests/Schema.V3SchemaCompilationTests.fs
@sergey-tihon
Copy link
Copy Markdown
Member

@copilot fix inline comments

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

@copilot fix inline comments

Fixed in commit 22fe96f. I removed the duplicate V3 integer-enum tests and tightened the $ref-to-enum assertions to verify the Status property type resolves to the named Status provided type.

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.300/FSharp/fsc.dll @/tmp/MSBuildTemp8LvX0O/tmp34c694f3d3224ef0bcf4c13c70981281.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 May 23, 2026 20:15
@sergey-tihon sergey-tihon merged commit 9aeafe9 into master May 23, 2026
2 checks passed
@sergey-tihon sergey-tihon deleted the repo-assist/test-schema-compilation-20260523-6d35769476499c5a branch May 23, 2026 21:01
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