Fix nullable date deserialization for OpenAPI v3 schemas#287
Merged
sergey-tihon merged 12 commits intomasterfrom Feb 1, 2026
Merged
Fix nullable date deserialization for OpenAPI v3 schemas#287sergey-tihon merged 12 commits intomasterfrom
sergey-tihon merged 12 commits intomasterfrom
Conversation
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
…lity Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix null date deserialization for PersonResponseDto
Fix nullable property deserialization in OpenAPI v3 provider
Jan 23, 2026
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
Fix nullable property deserialization in OpenAPI v3 provider
Fix CI build: upgrade actions and add dependency caching
Feb 1, 2026
Copilot
AI
changed the title
Fix CI build: upgrade actions and add dependency caching
Document existing Immich schema compilation test
Feb 1, 2026
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
Document existing Immich schema compilation test
Add deserialization tests for nullable date handling
Feb 1, 2026
Copilot
AI
changed the title
Add deserialization tests for nullable date handling
Fix nullable date deserialization in OpenAPI v3 provider
Feb 1, 2026
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
Fix nullable date deserialization in OpenAPI v3 provider
Fix nullable date deserialization in OpenAPI v3 type provider
Feb 1, 2026
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
Fix nullable date deserialization in OpenAPI v3 type provider
Fix nullable date deserialization and CI build for OpenAPI v3 provider
Feb 1, 2026
sergey-tihon
reviewed
Feb 1, 2026
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
Fix nullable date deserialization and CI build for OpenAPI v3 provider
Fix nullable date deserialization for OpenAPI v3 provider
Feb 1, 2026
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot
AI
changed the title
Fix nullable date deserialization for OpenAPI v3 provider
Fix nullable date deserialization for OpenAPI v3 schemas
Feb 1, 2026
sergey-tihon
approved these changes
Feb 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes OpenAPI v3 nullable: true handling so generated F# types correctly allow null values (notably for format: date), preventing JsonException during deserialization.
Changes:
- Update v3 schema compilation to treat
JsonSchemaType.Nullas nullable and avoid generating non-nullable value types for nullable schemas. - Add regression tests covering deserialization of
nulland non-null date values using the sameSystem.Text.Json+JsonFSharpConverterpath as runtime. - Modernize CI by upgrading checkout action and adding NuGet/Paket caches.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs |
Detect JsonSchemaType.Null on property schemas and apply consistent nullable/required logic for generated property types and ctor parameters. |
tests/SwaggerProvider.ProviderTests/v3/Swagger.NullableDate.Tests.fs |
Adds tests validating the generated birthDate is nullable and deserialization works for both null and valid date values. |
tests/SwaggerProvider.ProviderTests/Schemas/v3/nullable-date.yaml |
Minimal OpenAPI v3 schema reproducing the nullable date scenario. |
tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj |
Includes the new nullable date test file in the test project. |
.github/workflows/dotnetcore.yml |
Updates checkout action to v4 and adds caching for NuGet packages and .paket. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
OpenAPI 3.0 schemas with
nullable: truegenerated non-nullable F# types, causingJsonExceptionwhen deserializing null values. Microsoft.OpenApi v2.4+ representsnullable: trueasType: Null | ActualTypeusing flag combinations.Changes
Type generation (
src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs)JsonSchemaType.Nullflag on property schemas to determine nullabilityisSchemaNullablehelper to eliminate duplicationTest coverage (
tests/SwaggerProvider.ProviderTests/v3/Swagger.NullableDate.Tests.fs)JsonSerializer.DeserializewithJsonFSharpConverter(same runtime path)CI improvements (
.github/workflows/dotnetcore.yml)actions/checkout@v1→@v4Cleanup
TestNullableDate.fsxexploration scriptOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.