[repo-assist] test: integer enum, $ref-to-enum, v2 allOf collapse, v2 string enum (+9 tests, 459→468)#449
Conversation
…+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>
There was a problem hiding this comment.
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.
|
@copilot fix inline comments |
…ertions Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/faaae8f3-8672-45ac-b7da-4e504f49d63d Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Fixed in commit 22fe96f. I removed the duplicate V3 integer-enum tests and tightened the $ref-to-enum assertions to verify the 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
🤖 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-leveltype: integer+enumemits a namedProvidedTypeDefinitioninteger enum type is an enum—IsEnum = trueinteger 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$refto a string enum schema resolves to the enum type, notobjrequired property referencing a string enum is not wrapped in option— required enum $ref is not wrapped inOption<T>orNullable<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 usingallOf: [$ref]with no own properties collapsesv2 allOf single ref does not produce a separate wrapper type— no separate wrapper type emittedTop-level string enum
v2 top-level string enum compiles to a named enum type— adefinitionsentry withtype: string+enumemits a named provided typev2 top-level string enum type is an enum—IsEnum = trueTest Status