From 08a427410c8a66f02d3921e4d745ee052db5fa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Krzywizna?= Date: Tue, 24 Nov 2026 11:14:04 +0100 Subject: [PATCH 1/3] [SEL-138] Allow null for voption record fields FSharp.SystemTextJson writes ValueNone in a record field as null, but the schema showed only the inner type. Unwrapped voption now takes the same path as unwrapped option: record fields get the inner schema plus null, top-level values keep the inner schema only. Co-Authored-By: Claude Opus 5.5 --- README.md | 3 +-- skills/fsharp-systemtextjson-openapi/SKILL.md | 5 +++-- .../Option.fs | 16 ++++------------ ...lectView.FSharp.SystemTextJson.OpenApi.fsproj | 2 +- .../OpenApiOptionTests.fs | 2 +- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1118822..5350e8b 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,7 @@ schemas then do not match the JSON that FSharp.SystemTextJson writes. This package adds schema and document transformers that read your `JsonFSharpOptions` and describe the real JSON: -- `option` and `voption`: the inner value, and `null` for `option` record - fields +- `option` and `voption`: the inner value, and `null` for record fields - records: required and optional properties, including `Skippable<'T>` fields - unions: tags, internal, adjacent and external encodings, named fields, unwrapped cases, fieldless cases as strings, unions of only fieldless cases diff --git a/skills/fsharp-systemtextjson-openapi/SKILL.md b/skills/fsharp-systemtextjson-openapi/SKILL.md index 0247d47..db2eb64 100644 --- a/skills/fsharp-systemtextjson-openapi/SKILL.md +++ b/skills/fsharp-systemtextjson-openapi/SKILL.md @@ -67,8 +67,9 @@ reads. ## What the schema shows -- `option` record field: the inner schema plus `null`. Top-level `option` and - every `voption`: the inner schema only. +- `option` or `voption` record field: the inner schema plus `null`, because + `None` and `ValueNone` are written as `null`. Top-level `option` and + `voption`: the inner schema only. - With `UnwrapOption` turned off: `option` is `null` or a tagged `Some` object; `voption` is a tagged `ValueSome` or `ValueNone` object. - Records: a `Skippable<'T>` field is optional. With diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs index 7ddc0ee..538f551 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs @@ -70,7 +70,8 @@ type OptionSchemaTransformer(fsOptions: JsonFSharpOptions) = let! innerSchema = getOrCreateSchema innerType SchemaCopy.copyTo schema innerSchema - // Top-level option schemas are unwrapped, while option-valued record properties remain nullable. + // Top-level option and voption schemas are unwrapped, while option- and voption-valued record properties + // remain nullable: FSharp.SystemTextJson writes `None` and `ValueNone` as `null`. if not (isNull ctx.JsonPropertyInfo) then OpenApiSchemaHelpers.addNull schema innerSchema } @@ -142,21 +143,12 @@ type OptionSchemaTransformer(fsOptions: JsonFSharpOptions) = } :> Task - let transformUnwrappedValueOption innerType = - task { - // ValueOption<'T> is erased to 'T' in schemas without adding property nullability. - let! innerSchema = getOrCreateSchema innerType - SchemaCopy.copyTo schema innerSchema - } - :> Task - match ctx.JsonTypeInfo.Type with - | Helpers.FSharpOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> + | Helpers.FSharpOptionType innerType + | Helpers.FSharpValueOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> transformUnwrappedOption innerType | Helpers.FSharpOptionType innerType -> transformWrappedOption innerType - | Helpers.FSharpValueOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> - transformUnwrappedValueOption innerType | Helpers.FSharpValueOptionType innerType -> transformWrappedValueOption innerType | _ -> diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/SelectView.FSharp.SystemTextJson.OpenApi.fsproj b/src/SelectView.FSharp.SystemTextJson.OpenApi/SelectView.FSharp.SystemTextJson.OpenApi.fsproj index 4124ea7..3c897e8 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/SelectView.FSharp.SystemTextJson.OpenApi.fsproj +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/SelectView.FSharp.SystemTextJson.OpenApi.fsproj @@ -1,7 +1,7 @@ SelectView.FSharp.SystemTextJson.OpenApi - 0.1.0 + 0.1.1 SelectView Copyright (c) SelectView OpenAPI schemas for F# types serialized with FSharp.SystemTextJson. Schema and document transformers for Microsoft.AspNetCore.OpenApi that cover options, records, unions, tuples, enums and collections. diff --git a/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs b/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs index d00a82a..44468b6 100644 --- a/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs +++ b/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs @@ -135,7 +135,7 @@ let ``voption property schema matches snapshot`` () : Task = |> canonicalizeJson |> fun x -> x.ToJsonString(jsonOptions) - %schema.Should().Be(expectedOptionStringSchema) + %schema.Should().Be(expectedOptionPropertySchema) } [] From 8b43e8ffaa2fd18b5eda19e989f016d0bf10f8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Krzywizna?= Date: Tue, 24 Nov 2026 11:18:25 +0100 Subject: [PATCH 2/3] [SEL-138] Allow null for voption record and union fields in the shipped transformers The record and union transformers build field schemas themselves and only matched option, so voption fields still lacked null with the transformer set that AddOpenApiForSystemTextJson registers. Both now share one option-or-voption pattern. The option tests run the shipped set and assert the serialized JSON next to the schema. Co-Authored-By: Claude Opus 5.5 --- README.md | 3 +- skills/fsharp-systemtextjson-openapi/SKILL.md | 4 +- .../CommonHelpers.fs | 10 ++++ .../Option.fs | 3 +- .../Record.fs | 8 +-- .../Union.fs | 8 +-- .../OpenApiOptionTests.fs | 49 ++++++++++++++++++- 7 files changed, 64 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5350e8b..a4c5a16 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ schemas then do not match the JSON that FSharp.SystemTextJson writes. This package adds schema and document transformers that read your `JsonFSharpOptions` and describe the real JSON: -- `option` and `voption`: the inner value, and `null` for record fields +- `option` and `voption`: the inner value, and `null` for record and union + fields - records: required and optional properties, including `Skippable<'T>` fields - unions: tags, internal, adjacent and external encodings, named fields, unwrapped cases, fieldless cases as strings, unions of only fieldless cases diff --git a/skills/fsharp-systemtextjson-openapi/SKILL.md b/skills/fsharp-systemtextjson-openapi/SKILL.md index db2eb64..619649d 100644 --- a/skills/fsharp-systemtextjson-openapi/SKILL.md +++ b/skills/fsharp-systemtextjson-openapi/SKILL.md @@ -67,8 +67,8 @@ reads. ## What the schema shows -- `option` or `voption` record field: the inner schema plus `null`, because - `None` and `ValueNone` are written as `null`. Top-level `option` and +- `option` or `voption` record or union field: the inner schema plus `null`, + because `None` and `ValueNone` are written as `null`. Top-level `option` and `voption`: the inner schema only. - With `UnwrapOption` turned off: `option` is `null` or a tagged `Some` object; `voption` is a tagged `ValueSome` or `ValueNone` object. diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/CommonHelpers.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/CommonHelpers.fs index 81406ad..fcd20d3 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/CommonHelpers.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/CommonHelpers.fs @@ -10,6 +10,16 @@ open Microsoft.OpenApi module internal OpenApiSchemaHelpers = + let (|OptionOrValueOptionType|_|) (t: Type) = + if + t.IsGenericType + && (t.GetGenericTypeDefinition() = typedefof> + || t.GetGenericTypeDefinition() = typedefof>) + then + Some(t.GetGenericArguments()[0]) + else + None + let private hasSchemaTypeFlag (schemaType: JsonSchemaType) (flag: JsonSchemaType) = ((int schemaType) &&& (int flag)) = int flag diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs index 538f551..2bc8532 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/Option.fs @@ -70,8 +70,7 @@ type OptionSchemaTransformer(fsOptions: JsonFSharpOptions) = let! innerSchema = getOrCreateSchema innerType SchemaCopy.copyTo schema innerSchema - // Top-level option and voption schemas are unwrapped, while option- and voption-valued record properties - // remain nullable: FSharp.SystemTextJson writes `None` and `ValueNone` as `null`. + // Top-level option and voption schemas are unwrapped, while option- and voption-valued record properties remain nullable. if not (isNull ctx.JsonPropertyInfo) then OpenApiSchemaHelpers.addNull schema innerSchema } diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs index 8461214..4dcdb9b 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs @@ -21,12 +21,6 @@ module private RecordHelpers = else None - let (|FSharpOptionType|_|) (t: Type) = - if t.IsGenericType && t.GetGenericTypeDefinition() = typedefof> then - Some(t.GetGenericArguments()[0]) - else - None - let getRecordProperties (fsOptions: JsonFSharpOptions) (recordType: Type) = let fields = FSharpType.GetRecordFields(recordType, true) @@ -104,7 +98,7 @@ type RecordSchemaTransformer(fsOptions: JsonFSharpOptions) = let propertySchemaTask = match effectiveType with - | RecordHelpers.FSharpOptionType innerType when + | OpenApiSchemaHelpers.OptionOrValueOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> task { diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs index 52cdee5..ab29f56 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs @@ -13,12 +13,6 @@ open Microsoft.OpenApi module private UnionHelpers = - let (|FSharpOptionType|_|) (t: Type) = - if t.IsGenericType && t.GetGenericTypeDefinition() = typedefof> then - Some(t.GetGenericArguments()[0]) - else - None - let isFSharpOptionType (t: Type) = t.IsGenericType && t.GetGenericTypeDefinition() = typedefof> @@ -186,7 +180,7 @@ type UnionSchemaTransformer(fsOptions: JsonFSharpOptions) = let getFieldPropertySchema (ty: Type) = task { match ty with - | UnionHelpers.FSharpOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> + | OpenApiSchemaHelpers.OptionOrValueOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> let! innerSchema = getOrCreateSchema innerType let optionSchema = OpenApiSchema() SchemaCopy.copyTo optionSchema innerSchema diff --git a/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs b/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs index 44468b6..47f09fc 100644 --- a/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs +++ b/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs @@ -1,6 +1,7 @@ module SelectView.FSharp.SystemTextJson.OpenApi.Tests.OpenApiOptionTests open System +open System.Text.Json open System.Text.Json.Nodes open System.Text.Json.Serialization open System.Threading.Tasks @@ -10,6 +11,7 @@ open SelectView.FSharp.SystemTextJson.OpenApi open Giraffe open Giraffe.EndpointRouting open Giraffe.OpenApi +open Microsoft.AspNetCore.OpenApi open SelectView.FSharp.SystemTextJson.OpenApi.Tests.OpenApiTestSetup open Xunit @@ -19,6 +21,10 @@ type RecordWithOption = { [] Maybe: string option } type RecordWithVoption = { [] MaybeV: string voption } +type UnionWithVoption = + | WithVoption of maybeV: string voption + | WithNumber of n: int + let private endpoints : Endpoint list = [ POST [ @@ -57,8 +63,26 @@ let private endpoints : Endpoint list = ) ) ] + POST [ + route "/union-with-voption" (text "ok") + |> addOpenApi( + OpenApiConfig(requestBody = RequestBody(typeof, contentTypes = [| "application/json" |])) + ) + ] ] +let private shippedTransformers : IOpenApiSchemaTransformer list = + [ OptionSchemaTransformer(fsharpJsonOptions) :> IOpenApiSchemaTransformer + JsonNodeSchemaTransformer() + CollectionsSchemaTransformer() + RecordSchemaTransformer(fsharpJsonOptions) + TupleSchemaTransformer() + UnionSchemaTransformer(fsharpJsonOptions) + EnumSchemaTransformer() ] + +let private serialize value = + JsonSerializer.Serialize(value, fsharpJsonOptions.ToJsonSerializerOptions()) + let private getOptionPropertySchema (document: JsonNode) = getRecordPropertySchema document "/record-with-option" "maybe" @@ -114,7 +138,7 @@ let ``Option schema matches snapshot`` () : Task = let ``option property schema matches snapshot`` () : Task = task { let! builtIn = - fetchOpenApiJson (fun () -> createBuiltInOpenApiApp endpoints [ OptionSchemaTransformer(fsharpJsonOptions) ]) + fetchOpenApiJson (fun () -> createBuiltInOpenApiApp endpoints shippedTransformers) let schema = getOptionPropertySchema builtIn @@ -128,13 +152,34 @@ let ``option property schema matches snapshot`` () : Task = let ``voption property schema matches snapshot`` () : Task = task { let! builtIn = - fetchOpenApiJson (fun () -> createBuiltInOpenApiApp endpoints [ OptionSchemaTransformer(fsharpJsonOptions) ]) + fetchOpenApiJson (fun () -> createBuiltInOpenApiApp endpoints shippedTransformers) let schema = getVoptionPropertySchema builtIn |> canonicalizeJson |> fun x -> x.ToJsonString(jsonOptions) + %serialize({ MaybeV = ValueNone }).Should().Be("""{"maybeV":null}""") + %schema.Should().Be(expectedOptionPropertySchema) + } + +[] +let ``voption union field schema allows null`` () : Task = + task { + let! builtIn = fetchOpenApiJson (fun () -> createBuiltInOpenApiApp endpoints shippedTransformers) + + let caseSchema = + getSchemaForPath builtIn "/union-with-voption" + |> expandSchemaRefs builtIn + |> fun union -> getJsonPath union [ "oneOf" ] :?> JsonArray + |> Seq.find (fun case -> not (isNull (getJsonPath case [ "properties" ]).["maybeV"])) + + let schema = + getJsonPath caseSchema [ "properties"; "maybeV" ] + |> canonicalizeJson + |> fun x -> x.ToJsonString(jsonOptions) + + %serialize(WithVoption ValueNone).Should().Be("""{"kind":"WithVoption","maybeV":null}""") %schema.Should().Be(expectedOptionPropertySchema) } From ca32cc3dbf82691c60b84767f3c90c40b64fa193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Krzywizna?= Date: Tue, 24 Nov 2026 11:30:13 +0100 Subject: [PATCH 3/3] [SEL-138] Take option field encoding from the global options, not the parent's override FSharp.SystemTextJson encodes a nested option or voption field with the global options, even when the parent record or union overrides UnwrapOption with []. The record and union transformers used the parent's options, so they described a wrapped ValueNone as string or null. Co-Authored-By: Claude Opus 5.5 --- .../Record.fs | 6 +-- .../Union.fs | 4 +- .../OpenApiOptionTests.fs | 43 ++++++++++++++++--- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs index 4dcdb9b..6bbccb1 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/Record.fs @@ -48,6 +48,8 @@ module private RecordHelpers = type RecordSchemaTransformer(fsOptions: JsonFSharpOptions) = + let unwrapOptionFields = fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption + interface IOpenApiSchemaTransformer with member _.TransformAsync (schema: OpenApiSchema, ctx: OpenApiSchemaTransformerContext, ct: CancellationToken) @@ -98,9 +100,7 @@ type RecordSchemaTransformer(fsOptions: JsonFSharpOptions) = let propertySchemaTask = match effectiveType with - | OpenApiSchemaHelpers.OptionOrValueOptionType innerType when - fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption - -> + | OpenApiSchemaHelpers.OptionOrValueOptionType innerType when unwrapOptionFields -> task { let! innerSchema = getOrCreateSchema innerType diff --git a/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs b/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs index ab29f56..fc48143 100644 --- a/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs +++ b/src/SelectView.FSharp.SystemTextJson.OpenApi/Union.fs @@ -154,6 +154,8 @@ module private UnionCasePromotionPlan = | NonNull metadata -> metadata.Remove(MetadataKey) |> ignore type UnionSchemaTransformer(fsOptions: JsonFSharpOptions) = + let unwrapOptionFields = fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption + interface IOpenApiSchemaTransformer with member _.TransformAsync(schema: OpenApiSchema, ctx: OpenApiSchemaTransformerContext, ct: CancellationToken) : Task = let t = ctx.JsonTypeInfo.Type @@ -180,7 +182,7 @@ type UnionSchemaTransformer(fsOptions: JsonFSharpOptions) = let getFieldPropertySchema (ty: Type) = task { match ty with - | OpenApiSchemaHelpers.OptionOrValueOptionType innerType when fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption -> + | OpenApiSchemaHelpers.OptionOrValueOptionType innerType when unwrapOptionFields -> let! innerSchema = getOrCreateSchema innerType let optionSchema = OpenApiSchema() SchemaCopy.copyTo optionSchema innerSchema diff --git a/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs b/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs index 47f09fc..7f05d4f 100644 --- a/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs +++ b/tests/SelectView.FSharp.SystemTextJson.OpenApi.Tests/OpenApiOptionTests.fs @@ -21,6 +21,9 @@ type RecordWithOption = { [] Maybe: string option } type RecordWithVoption = { [] MaybeV: string voption } +[] +type RecordWithUnwrapOverride = { [] MaybeV: string voption } + type UnionWithVoption = | WithVoption of maybeV: string voption | WithNumber of n: int @@ -63,6 +66,12 @@ let private endpoints : Endpoint list = ) ) ] + POST [ + route "/record-with-unwrap-override" (text "ok") + |> addOpenApi( + OpenApiConfig(requestBody = RequestBody(typeof, contentTypes = [| "application/json" |])) + ) + ] POST [ route "/union-with-voption" (text "ok") |> addOpenApi( @@ -71,17 +80,21 @@ let private endpoints : Endpoint list = ] ] -let private shippedTransformers : IOpenApiSchemaTransformer list = - [ OptionSchemaTransformer(fsharpJsonOptions) :> IOpenApiSchemaTransformer +let private shippedTransformersFor (fsOptions: JsonFSharpOptions) : IOpenApiSchemaTransformer list = + [ OptionSchemaTransformer(fsOptions) JsonNodeSchemaTransformer() CollectionsSchemaTransformer() - RecordSchemaTransformer(fsharpJsonOptions) + RecordSchemaTransformer(fsOptions) TupleSchemaTransformer() - UnionSchemaTransformer(fsharpJsonOptions) + UnionSchemaTransformer(fsOptions) EnumSchemaTransformer() ] -let private serialize value = - JsonSerializer.Serialize(value, fsharpJsonOptions.ToJsonSerializerOptions()) +let private shippedTransformers = shippedTransformersFor fsharpJsonOptions + +let private serializeWith (fsOptions: JsonFSharpOptions) value = + JsonSerializer.Serialize(value, fsOptions.ToJsonSerializerOptions()) + +let private serialize value = serializeWith fsharpJsonOptions value let private getOptionPropertySchema (document: JsonNode) = getRecordPropertySchema document "/record-with-option" "maybe" @@ -159,7 +172,7 @@ let ``voption property schema matches snapshot`` () : Task = |> canonicalizeJson |> fun x -> x.ToJsonString(jsonOptions) - %serialize({ MaybeV = ValueNone }).Should().Be("""{"maybeV":null}""") + %serialize({ RecordWithVoption.MaybeV = ValueNone }).Should().Be("""{"maybeV":null}""") %schema.Should().Be(expectedOptionPropertySchema) } @@ -183,6 +196,22 @@ let ``voption union field schema allows null`` () : Task = %schema.Should().Be(expectedOptionPropertySchema) } +[] +let ``voption field follows the global UnwrapOption, not the parent record's override`` () : Task = + task { + let fsOptions = fsharpJsonOptions.WithUnwrapOption(false) + + let! builtIn = fetchOpenApiJson (fun () -> createBuiltInOpenApiApp endpoints (shippedTransformersFor fsOptions)) + + let schema = + getRecordPropertySchema builtIn "/record-with-unwrap-override" "maybeV" + |> expandSchemaRefs builtIn + |> fun x -> x.ToJsonString() + + %(serializeWith fsOptions { RecordWithUnwrapOverride.MaybeV = ValueNone }).Should().Be("""{"maybeV":{"kind":"ValueNone"}}""") + %schema.Should().Contain("\"ValueNone\"").And.NotContain("\"null\"") + } + [] let ``Option schema matches encoding (WithUnwrapOption disabled)`` () : Task = task {