JSONSchema - robbyxp1/QuickJSON GitHub Wiki
QuickJSON
QuickJSON
JSONSchema Class
JSchema is a static class holding experimental schema decoders
Implements 2022-12 https://json-schema.org/specification
Except If/then/else
Except format (accepted but not checked)
public class JSONSchema
Inheritance System.Object 🡒 JSONSchema
Constructors
JSONSchema.JSONSchema(JObject) Constructor
Create and load a schema
public JSONSchema(QuickJSON.JObject rootschema);
Parameters
rootschema JObject
Properties
JSONSchema.Errors Property
Errors encountered
public string Errors { get; set; }
Property Value
JSONSchema.Warnings Property
Warnings encountered
public string Warnings { get; set; }
Property Value
Methods
JSONSchema.Validate(JObject) Method
Validate schema
public static string Validate(QuickJSON.JObject jschema);
Parameters
jschema JObject
schema
Returns
System.String
Empty string no errors, else a list of \n separated errors
JSONSchema.Validate(JObject, JToken) Method
Parse a schema, with input
public static string Validate(QuickJSON.JObject jschema, QuickJSON.JToken jinput);
Parameters
jschema JObject
schema
jinput JToken
input
Returns
System.String
Empty string no errors, else a list of \n separated errors
JSONSchema.Validate(JObject, string, ParseOptions) Method
Parse a schema, with input
public string Validate(QuickJSON.JObject jschema, string inputstring, QuickJSON.JToken.ParseOptions parseoptions=QuickJSON.JToken.ParseOptions.CheckEOL);
Parameters
jschema JObject
schema
inputstring System.String
input JSON data as string
parseoptions ParseOptions
JSON parse options
Returns
System.String
Empty string no errors, else a list of \n separated errors
JSONSchema.Validate(JToken) Method
Parse a schema, with optional input
public string Validate(QuickJSON.JToken jinput=null);
Parameters
jinput JToken
input
Returns
System.String
Empty string no errors, else a list of \n separated errors
JSONSchema.Validate(string) Method
Validate schema
public static string Validate(string schemastring);
Parameters
schemastring System.String
schema as string
Returns
System.String
Empty string no errors, else a list of \n separated errors
JSONSchema.Validate(string, JToken, ParseOptions) Method
Parse a schema, with input
public static string Validate(string schemastring, QuickJSON.JToken jinput, QuickJSON.JToken.ParseOptions parseoptions=QuickJSON.JToken.ParseOptions.CheckEOL);
Parameters
schemastring System.String
schema as string
jinput JToken
input as JSON
parseoptions ParseOptions
JSON parse options
Returns
System.String
Empty string no errors, else a list of \n separated errors
JSONSchema.Validate(string, string, ParseOptions) Method
Parse a schema, with input
public static string Validate(string schemastring, string inputstring, QuickJSON.JToken.ParseOptions parseoptions=QuickJSON.JToken.ParseOptions.CheckEOL);
Parameters
schemastring System.String
schema as string
inputstring System.String
input JSON data as string
parseoptions ParseOptions
JSON parse options
Returns
System.String
Empty string no errors, else a list of \n separated errors