@@ -119,7 +119,7 @@ private static JsonSchema MapJsonSchemaCore(
119119 if ( ! ReflectionHelpers . IsBuiltInConverter ( effectiveConverter ) )
120120 {
121121 // Return a `true` schema for types with user-defined converters.
122- return CompleteSchema ( ref state , JsonSchema . True ) ;
122+ return CompleteSchema ( ref state , JsonSchema . CreateTrueSchema ( ) ) ;
123123 }
124124
125125 if ( parentPolymorphicTypeInfo is null && typeInfo . PolymorphismOptions is { DerivedTypes . Count : > 0 } polyOptions )
@@ -245,7 +245,7 @@ private static JsonSchema MapJsonSchemaCore(
245245 if ( effectiveUnmappedMemberHandling is JsonUnmappedMemberHandling . Disallow )
246246 {
247247 // Disallow unspecified properties.
248- additionalProperties = JsonSchema . False ;
248+ additionalProperties = JsonSchema . CreateFalseSchema ( ) ;
249249 }
250250
251251 if ( typeDiscriminator is { } typeDiscriminatorPair )
@@ -435,7 +435,7 @@ private static JsonSchema MapJsonSchemaCore(
435435 }
436436 else
437437 {
438- schema = JsonSchema . True ;
438+ schema = JsonSchema . CreateTrueSchema ( ) ;
439439 }
440440
441441 return CompleteSchema ( ref state , schema ) ;
@@ -578,7 +578,7 @@ private static string FormatJsonPointer(ReadOnlySpan<string> path)
578578
579579 private static readonly Dictionary < Type , Func < JsonNumberHandling , JsonSchema > > _simpleTypeSchemaFactories = new ( )
580580 {
581- [ typeof ( object ) ] = _ => JsonSchema . True ,
581+ [ typeof ( object ) ] = _ => JsonSchema . CreateTrueSchema ( ) ,
582582 [ typeof ( bool ) ] = _ => new JsonSchema { Type = JsonSchemaType . Boolean } ,
583583 [ typeof ( byte ) ] = numberHandling => GetSchemaForNumericType ( JsonSchemaType . Integer , numberHandling ) ,
584584 [ typeof ( ushort ) ] = numberHandling => GetSchemaForNumericType ( JsonSchemaType . Integer , numberHandling ) ,
@@ -625,10 +625,10 @@ private static string FormatJsonPointer(ReadOnlySpan<string> path)
625625 Pattern = @"^\d+(\.\d+){1,3}$" ,
626626 } ,
627627
628- [ typeof ( JsonDocument ) ] = _ => JsonSchema . True ,
629- [ typeof ( JsonElement ) ] = _ => JsonSchema . True ,
630- [ typeof ( JsonNode ) ] = _ => JsonSchema . True ,
631- [ typeof ( JsonValue ) ] = _ => JsonSchema . True ,
628+ [ typeof ( JsonDocument ) ] = _ => JsonSchema . CreateTrueSchema ( ) ,
629+ [ typeof ( JsonElement ) ] = _ => JsonSchema . CreateTrueSchema ( ) ,
630+ [ typeof ( JsonNode ) ] = _ => JsonSchema . CreateTrueSchema ( ) ,
631+ [ typeof ( JsonValue ) ] = _ => JsonSchema . CreateTrueSchema ( ) ,
632632 [ typeof ( JsonObject ) ] = _ => new JsonSchema { Type = JsonSchemaType . Object } ,
633633 [ typeof ( JsonArray ) ] = _ => new JsonSchema { Type = JsonSchemaType . Array } ,
634634 } ;
0 commit comments