Repository navigation
feat: Handle allOf with single reference - #284
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #279 by enabling the SwaggerProvider to compile OpenAPI schemas that have the nullable: true attribute combined with allOf references. The fix adds support for handling JsonSchemaType.Null in the type compilation logic.
- Added a condition to treat
JsonSchemaType.Nullas an object type in the schema compiler - Added a test case with a schema demonstrating the
allOf+nullablepattern
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs | Added pattern match case to handle JsonSchemaType.Null by compiling it as an object |
| tests/SwaggerProvider.ProviderTests/v3/Swagger.I0279.Tests.fs | New compilation test for issue 279 |
| tests/SwaggerProvider.ProviderTests/Schemas/v3/issue279.json | Test schema with allOf and nullable: true pattern |
| tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj | Added new test file to project |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #279