73 references to JsonSchemaType
System.Text.Json (73)
System\Text\Json\Schema\JsonSchema.cs (25)
53public JsonSchemaType Type { get => _type; set { VerifyMutable(); _type = value; } } 54private JsonSchemaType _type = JsonSchemaType.Any; 113Count(Type != JsonSchemaType.Any); 145if (Type != JsonSchemaType.Any) 147Type |= JsonSchemaType.Null; 290private static ReadOnlySpan<JsonSchemaType> s_schemaValues => 293JsonSchemaType.String, 294JsonSchemaType.Integer, 295JsonSchemaType.Number, 296JsonSchemaType.Boolean, 297JsonSchemaType.Array, 298JsonSchemaType.Object, 299JsonSchemaType.Null, 312public static JsonNode? MapSchemaType(JsonSchemaType schemaType) 314if (schemaType is JsonSchemaType.Any) 325foreach (JsonSchemaType type in s_schemaValues) 335static string? ToIdentifier(JsonSchemaType schemaType) 339JsonSchemaType.Null => "null", 340JsonSchemaType.Boolean => "boolean", 341JsonSchemaType.Integer => "integer", 342JsonSchemaType.Number => "number", 343JsonSchemaType.String => "string", 344JsonSchemaType.Array => "array", 345JsonSchemaType.Object => "object",
System\Text\Json\Schema\JsonSchemaExporter.cs (10)
112JsonSchemaType schemaType = JsonSchemaType.Any; 155schemaType = JsonSchemaType.Any; 163if (schemaType is not JsonSchemaType.Any) 169derivedSchema.Type = JsonSchemaType.Any; 266Type = JsonSchemaType.Object, 283Type = JsonSchemaType.Array, 307Type = JsonSchemaType.Object, 314Type = JsonSchemaType.Array, 344Type = JsonSchemaType.Object,
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\ByteConverter.cs (1)
61GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
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\DecimalConverter.cs (1)
61GetSchemaForNumericType(JsonSchemaType.Number, numberHandling);
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (1)
72GetSchemaForNumericType(JsonSchemaType.Number, numberHandling, isIeeeFloatingPoint: true);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (2)
507return new() { Type = JsonSchemaType.String }; 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\HalfConverter.cs (1)
136GetSchemaForNumericType(JsonSchemaType.Number, numberHandling, isIeeeFloatingPoint: true);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (1)
110GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (1)
64GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (1)
64GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (1)
62GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (6)
36private protected static JsonSchema GetSchemaForNumericType(JsonSchemaType schemaType, JsonNumberHandling numberHandling, bool isIeeeFloatingPoint = false) 38Debug.Assert(schemaType is JsonSchemaType.Integer or JsonSchemaType.Number); 39Debug.Assert(!isIeeeFloatingPoint || schemaType is JsonSchemaType.Number); 47pattern = schemaType is JsonSchemaType.Integer 53schemaType |= JsonSchemaType.String;
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)
62GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (1)
73GetSchemaForNumericType(JsonSchemaType.Number, numberHandling, isIeeeFloatingPoint: true);
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)
99Type = JsonSchemaType.String,
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (1)
110GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (1)
64GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (1)
64GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (1)
62GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling);
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
57new() { Type = JsonSchemaType.String, Format = "uri" };
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (1)
132Type = JsonSchemaType.String,