Einhugur JSON Plugin III for Xojo

EinhugurJSONIII.JSONSchemaDocument Class (console safe)

JSONScemaDocument is class to describe validation schema to validate JSON documents.

Object
   JSONSchemaDocument

class EinhugurJSONIII.JSONSchemaDocument

Constructors

JSONSchemaDocumentPrivate constructor.

Methods

CreateValidatorCreates validator from the schema.

Delegates

RemoteSchemaProviderDelegate (console safe) Delegate for routines to resolve remote schemas.

Examples

Normal procedure would be to read JSON schema document by using JSONDocument and then parse the schema. Then schema would be used to build validator object.
Compiled schema can be re-used many times. Validator object can be re-used if it is reset in between runs.


// First we read the schema (Scehma.json which is included with this project)
var schemaDoc as JSONDocument = new JSONDocument()

if schemaDoc.Parse(Schema) then
    // We build the schema - Note the built scema we can store and reuse
    var schema as JSONSchemaDocument = schemaDoc.BuildSchema()
   
    // We create SchemaValidator - validator can be re-used if resetting it in between runs with the Reset method.
    var validator as JSONSchemaValidator = schema.CreateValidator()
   
End if



More complete example can be found on the JSONSchemaValidator class.

Supported Platforms:

  • macOS Intel 32 bit
  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit
  • iOS