36 instantiations of JsonSchema
System.Text.Json (36)
System\Text\Json\Schema\JsonSchema.cs (4)
29public static JsonSchema CreateFalseSchema() => new(false); 30public static JsonSchema CreateTrueSchema() => new(true); 282schema = new JsonSchema { Not = CreateTrueSchema() }; 285schema = new JsonSchema();
System\Text\Json\Schema\JsonSchemaExporter.cs (8)
86return CompleteSchema(ref state, new JsonSchema { Ref = existingJsonPointer }); 130JsonSchema discriminatorSchema = new() { Constant = discriminatorNode }; 181return CompleteSchema(ref state, new() 264return CompleteSchema(ref state, new() 281return CompleteSchema(ref state, new() 305return CompleteSchema(ref state, new() 312new JsonSchema() 342return CompleteSchema(ref state, new()
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
43internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.Array };
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
69internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.Object };
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
41internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.Boolean };
System\Text\Json\Serialization\Converters\Value\ByteArrayConverter.cs (1)
32internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
65new() { Type = JsonSchemaType.String, MinLength = 1, MaxLength = 1 };
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (1)
74internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String, Format = "date" };
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
32internal override JsonSchema? GetSchema(JsonNumberHandling _) => new JsonSchema { Type = JsonSchemaType.String, Format = "date-time" };
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
32internal override JsonSchema? GetSchema(JsonNumberHandling _) => new JsonSchema { Type = JsonSchemaType.String, Format = "date-time" };
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (3)
507return new() { Type = JsonSchemaType.String }; 516return new() { Enum = enumValues }; 519return new() { Type = JsonSchemaType.Integer };
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
34new() { Type = JsonSchemaType.String, Format = "uuid" };
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (4)
58return new JsonSchema 62new JsonSchema { Type = schemaType, Pattern = pattern }, 63new JsonSchema { Enum = [(JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity"] }, 68return new JsonSchema { Type = schemaType, Pattern = pattern };
System\Text\Json\Serialization\Converters\Value\MemoryByteConverter.cs (1)
23internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\ReadOnlyMemoryByteConverter.cs (1)
23internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
56internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (1)
99internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String, Format = "time" };
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (1)
97internal override JsonSchema? GetSchema(JsonNumberHandling _) => new()
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (1)
24new JsonSchema { Comment = "Unsupported .NET type", Not = JsonSchema.CreateTrueSchema() };
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
57new() { Type = JsonSchemaType.String, Format = "uri" };
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (1)
130new()
88 references to JsonSchema
System.Text.Json (88)
System\Text\Json\Schema\JsonSchema.cs (15)
29public static JsonSchema CreateFalseSchema() => new(false); 30public static JsonSchema CreateTrueSchema() => new(true); 65public List<KeyValuePair<string, JsonSchema>>? Properties { get => _properties; set { VerifyMutable(); _properties = value; } } 66private List<KeyValuePair<string, JsonSchema>>? _properties; 71public JsonSchema? Items { get => _items; set { VerifyMutable(); _items = value; } } 72private JsonSchema? _items; 74public JsonSchema? AdditionalProperties { get => _additionalProperties; set { VerifyMutable(); _additionalProperties = value; } } 75private JsonSchema? _additionalProperties; 80public JsonSchema? Not { get => _not; set { VerifyMutable(); _not = value; } } 81private JsonSchema? _not; 83public List<JsonSchema>? AnyOf { get => _anyOf; set { VerifyMutable(); _anyOf = value; } } 84private List<JsonSchema>? _anyOf; 193foreach (KeyValuePair<string, JsonSchema> property in Properties) 235foreach (JsonSchema schema in AnyOf) 277public static void EnsureMutable(ref JsonSchema schema)
System\Text\Json\Schema\JsonSchemaExporter.cs (26)
62JsonSchema schema = MapJsonSchemaCore(ref state, typeInfo); 66private static JsonSchema MapJsonSchemaCore( 75KeyValuePair<string, JsonSchema>? typeDiscriminator = null, 113List<JsonSchema>? anyOf = new(derivedTypes.Count); 115state.PushSchemaNode(JsonSchema.AnyOfPropertyName); 121KeyValuePair<string, JsonSchema>? derivedTypeDiscriminator = null; 130JsonSchema discriminatorSchema = new() { Constant = discriminatorNode }; 137JsonSchema derivedSchema = MapJsonSchemaCore( 167foreach (JsonSchema derivedSchema in anyOf) 207List<KeyValuePair<string, JsonSchema>>? properties = null; 209JsonSchema? additionalProperties = null; 214additionalProperties = JsonSchema.CreateFalseSchema(); 227state.PushSchemaNode(JsonSchema.PropertiesPropertyName); 236JsonSchema propertySchema = MapJsonSchemaCore( 247JsonSchema.EnsureMutable(ref propertySchema); 277state.PushSchemaNode(JsonSchema.ItemsPropertyName); 278JsonSchema items = MapJsonSchemaCore(ref state, typeInfo.ElementTypeInfo, customNumberHandling: effectiveNumberHandling); 295state.PushSchemaNode(JsonSchema.PropertiesPropertyName); 297state.PushSchemaNode(JsonSchema.ItemsPropertyName); 299JsonSchema items = MapJsonSchemaCore(ref state, typeInfo.ElementTypeInfo, customNumberHandling: effectiveNumberHandling); 325List<KeyValuePair<string, JsonSchema>>? dictProps = null; 338state.PushSchemaNode(JsonSchema.AdditionalPropertiesPropertyName); 339JsonSchema valueSchema = MapJsonSchemaCore(ref state, typeInfo.ElementTypeInfo, customNumberHandling: effectiveNumberHandling); 353return CompleteSchema(ref state, JsonSchema.CreateTrueSchema()); 356JsonSchema CompleteSchema(ref GenerationState state, JsonSchema schema)
System\Text\Json\Serialization\Converters\CastingConverter.cs (1)
78internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling)
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
71internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling)
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
43internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.Array };
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (2)
83internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
69internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.Object };
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (2)
34internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (2)
150internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
41internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.Boolean };
System\Text\Json\Serialization\Converters\Value\ByteArrayConverter.cs (1)
32internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (1)
60internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
64internal override JsonSchema? GetSchema(JsonNumberHandling _) =>
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (1)
74internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String, Format = "date" };
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
32internal override JsonSchema? GetSchema(JsonNumberHandling _) => new JsonSchema { Type = JsonSchemaType.String, Format = "date-time" };
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
32internal override JsonSchema? GetSchema(JsonNumberHandling _) => new JsonSchema { Type = JsonSchemaType.String, Format = "date-time" };
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (1)
60internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (1)
71internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
497internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling)
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
33internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (1)
135internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (1)
109internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (1)
63internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (1)
63internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (1)
61internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\JsonDocumentConverter.cs (2)
29internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
System\Text\Json\Serialization\Converters\Value\JsonElementConverter.cs (2)
21internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (1)
36private protected static JsonSchema GetSchemaForNumericType(JsonSchemaType schemaType, JsonNumberHandling numberHandling, bool isIeeeFloatingPoint = false)
System\Text\Json\Serialization\Converters\Value\MemoryByteConverter.cs (1)
23internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\ReadOnlyMemoryByteConverter.cs (1)
23internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (1)
61internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (1)
72internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
56internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String };
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (1)
99internal override JsonSchema? GetSchema(JsonNumberHandling _) => new() { Type = JsonSchemaType.String, Format = "time" };
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (1)
97internal override JsonSchema? GetSchema(JsonNumberHandling _) => new()
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (1)
109internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (1)
63internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (1)
63internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (1)
61internal override JsonSchema? GetSchema(JsonNumberHandling numberHandling) =>
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (2)
23internal override JsonSchema? GetSchema(JsonNumberHandling _) => 24new JsonSchema { Comment = "Unsupported .NET type", Not = JsonSchema.CreateTrueSchema() };
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
56internal override JsonSchema? GetSchema(JsonNumberHandling _) =>
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (1)
129internal override JsonSchema? GetSchema(JsonNumberHandling _) =>
System\Text\Json\Serialization\JsonConverter.cs (1)
219internal virtual JsonSchema? GetSchema(JsonNumberHandling numberHandling) => null;