Could be a JSON schema with properties or contain an $id key which is used to fetch them
Options to parse the schema like whether to use defaults and what defaults to use
Whether to update parsingOpts for any missing options with default options. Pass false
when deserializing to get the exact object that was serialized which is necessary when verifying signatures
Optionaloverrides: Partial<ISchemaOverrides>Override any properties of the schema
OptionalfullJsonSchema: IEmbeddedJsonSchemaWhen jsonSchema does not contain the properties, this object is expected to contain them.
Set to false when creating legacy schemas
OptionalfullReadonlyjsonReadonlyparsingReadonlyschemaStaticIGNORE_Keys to ignore from generic validation as they are already validated
StaticIMPLICIT_Implicit fields for schema version >= 0.4.0
StaticJSON_Custom definitions for JSON schema syntax
StaticJSON_Custom override definitions for JSON schema syntax. Any refs in the jsonschema that reference these will be overwritten
StaticOLD_Implicit fields for schema version < 0.4.0
StaticPOSSIBLE_StaticRESERVED_CredentialBuilder subject/claims cannot have any of these names
StaticVERSIONFollows semver and must be updated accordingly when the logic of this class changes or the underlying crypto changes.
Gets the embedded JSON schema either from the one that was provided or the one that was fetched.
StaticconvertStaticconvertConvert schema JSON to a data URI
Optionalversion: stringThe schema version. This is needed as a different conversion to JSON function was used in older version and backward compatibility is needed.
StaticconvertConvert a schema object as per JSON-schema syntax (IJsonSchema) to the internal representation (ISchema).
Currently, does not check if the needed JSON-schema definitions are actually present but assumes that they will be
already passed.
Name of the node, used for throwing more informative error message
OptionalrootObject: objectStaticessentialEssential properties of a non-embedded schema.
add custom definitions as well
StaticflattenStaticfromJSONStaticfromJSONWithSimilar to this.fromJSON but can load an externally referenced schema if the given schema is not an embedded one.
StaticgenerateGenerate a schema based on the credential and with the help of a schema that defines some fields. For fields with a conflicting types between credential and schema, error will be thrown. For extra keys or items in schema, they will be removed in the returned schema. The missing keys or items in schema will be added in the returned schema.
StaticgetStaticgetStaticisReturns true if the given object is an embedded schema, i.e. it has the properties key set.
StaticnewSame as the constructor of this class but gets the JSON schema from a callback
The JSON schema that contains the URL to fetch the full JSON schema, i.e. properties
The callback that takes the $id field of jsonSchema and returns the full JSON schema.
Optionaloverrides: Partial<ISchemaOverrides>StaticparseStaticparseOptionalminimum?: numberStaticparseOptionalminimum?: numberStaticparseOptionalminimum?: numberStaticstatusStatictypeStatictypeStaticvalidateValidates the internal representation of schema
Staticvalidate
Takes a schema object as per JSON-schema syntax (
IJsonSchema), validates it and converts it to an internal representation (ISchema) and stores both as the one with JSON-schema syntax is added to the credential representation.