33 instantiations of JsonSchema
Shared (33)
JsonSchemaExporter\JsonSchemaExporter.cs (29)
112return CompleteSchema(ref state, new JsonSchema { Ref = existingJsonPointer }); 159JsonSchema discriminatorSchema = new() { Constant = discriminatorNode }; 210schema = new() 337return CompleteSchema(ref state, new() 355return CompleteSchema(ref state, new() 379return CompleteSchema(ref state, new() 386new JsonSchema 417return CompleteSchema(ref state, new() 586[typeof(bool)] = _ => new JsonSchema { Type = JsonSchemaType.Boolean }, 605[typeof(char)] = _ => new JsonSchema { Type = JsonSchemaType.String, MinLength = 1, MaxLength = 1 }, 606[typeof(string)] = _ => new JsonSchema { Type = JsonSchemaType.String }, 607[typeof(byte[])] = _ => new JsonSchema { Type = JsonSchemaType.String }, 608[typeof(Memory<byte>)] = _ => new JsonSchema { Type = JsonSchemaType.String }, 609[typeof(ReadOnlyMemory<byte>)] = _ => new JsonSchema { Type = JsonSchemaType.String }, 610[typeof(DateTime)] = _ => new JsonSchema { Type = JsonSchemaType.String, Format = "date-time" }, 611[typeof(DateTimeOffset)] = _ => new JsonSchema { Type = JsonSchemaType.String, Format = "date-time" }, 612[typeof(TimeSpan)] = _ => new JsonSchema 623[typeof(Guid)] = _ => new JsonSchema { Type = JsonSchemaType.String, Format = "uuid" }, 624[typeof(Uri)] = _ => new JsonSchema { Type = JsonSchemaType.String, Format = "uri" }, 625[typeof(Version)] = _ => new JsonSchema 636[typeof(JsonObject)] = _ => new JsonSchema { Type = JsonSchemaType.Object }, 637[typeof(JsonArray)] = _ => new JsonSchema { Type = JsonSchemaType.Array }, 668return new JsonSchema 672new JsonSchema { Type = schemaType, Pattern = pattern }, 673new JsonSchema { Enum = new() { (JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity" } }, 678return new JsonSchema { Type = schemaType, Pattern = pattern }; 753return new() { Type = JsonSchemaType.String }; 765return new() { Enum = enumValues }; 768return new() { Type = JsonSchemaType.Integer };
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (4)
20public static JsonSchema CreateFalseSchema() => new(false); 21public static JsonSchema CreateTrueSchema() => new(true); 470schema = new JsonSchema { Not = JsonSchema.CreateTrueSchema() }; 473schema = new JsonSchema();
47 references to JsonSchema
Shared (47)
JsonSchemaExporter\JsonSchemaExporter.cs (31)
83JsonSchema schema = MapJsonSchemaCore(ref state, typeInfo); 88private static JsonSchema MapJsonSchemaCore( 101KeyValuePair<string, JsonSchema>? typeDiscriminator = null, 115JsonSchema schema; 122return CompleteSchema(ref state, JsonSchema.CreateTrueSchema()); 142List<JsonSchema>? anyOf = new(derivedTypes.Count); 150KeyValuePair<string, JsonSchema>? derivedTypeDiscriminator = null; 159JsonSchema discriminatorSchema = new() { Constant = discriminatorNode }; 166JsonSchema derivedSchema = MapJsonSchemaCore( 196foreach (JsonSchema derivedSchema in anyOf) 240List<KeyValuePair<string, JsonSchema>>? properties = null; 242JsonSchema? additionalProperties = null; 248additionalProperties = JsonSchema.CreateFalseSchema(); 308JsonSchema propertySchema = MapJsonSchemaCore( 323JsonSchema.EnsureMutable(ref propertySchema); 352JsonSchema items = MapJsonSchemaCore(ref state, elementTypeInfo, customNumberHandling: effectiveNumberHandling); 373JsonSchema items = MapJsonSchemaCore(ref state, elementTypeInfo, customNumberHandling: effectiveNumberHandling); 400List<KeyValuePair<string, JsonSchema>>? dictProps = null; 414JsonSchema valueSchema = MapJsonSchemaCore(ref state, valueTypeInfo, customNumberHandling: effectiveNumberHandling); 428if (_simpleTypeSchemaFactories.TryGetValue(typeInfo.Type, out Func<JsonNumberHandling, JsonSchema>? simpleTypeSchemaFactory)) 438schema = JsonSchema.CreateTrueSchema(); 444JsonSchema CompleteSchema(ref GenerationState state, JsonSchema schema) 583private static readonly Dictionary<Type, Func<JsonNumberHandling, JsonSchema>> _simpleTypeSchemaFactories = new() 585[typeof(object)] = _ => JsonSchema.CreateTrueSchema(), 632[typeof(JsonDocument)] = _ => JsonSchema.CreateTrueSchema(), 633[typeof(JsonElement)] = _ => JsonSchema.CreateTrueSchema(), 634[typeof(JsonNode)] = _ => JsonSchema.CreateTrueSchema(), 635[typeof(JsonValue)] = _ => JsonSchema.CreateTrueSchema(), 641private static JsonSchema GetSchemaForNumericType(JsonSchemaType schemaType, JsonNumberHandling numberHandling, bool isIeeeFloatingPoint = false) 734private static JsonSchema GetEnumConverterSchema(JsonTypeInfo typeInfo, JsonConverter converter)
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (16)
20public static JsonSchema CreateFalseSchema() => new(false); 21public static JsonSchema CreateTrueSchema() => new(true); 144public List<KeyValuePair<string, JsonSchema>>? Properties 154private List<KeyValuePair<string, JsonSchema>>? _properties; 168public JsonSchema? Items 178private JsonSchema? _items; 180public JsonSchema? AdditionalProperties 190private JsonSchema? _additionalProperties; 204public JsonSchema? Not 214private JsonSchema? _not; 216public List<JsonSchema>? AnyOf 226private List<JsonSchema>? _anyOf; 384foreach (KeyValuePair<string, JsonSchema> property in Properties) 426foreach (JsonSchema schema in AnyOf) 465public static void EnsureMutable(ref JsonSchema schema) 470schema = new JsonSchema { Not = JsonSchema.CreateTrueSchema() };