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
Optional
overrides: Partial<ISchemaOverrides>Override any properties of the schema
Optional
fullJsonSchema: IEmbeddedJsonSchemaWhen jsonSchema
does not contain the properties, this object is expected to contain them.
Set to false when creating legacy schemas
Optional
fullReadonly
jsonReadonly
parsingReadonly
schemaStatic
IGNORE_Keys to ignore from generic validation as they are already validated
Static
IMPLICIT_Implicit fields for schema version >= 0.4.0
Static
JSON_Custom definitions for JSON schema syntax
Static
JSON_Custom override definitions for JSON schema syntax. Any refs in the jsonschema that reference these will be overwritten
Static
OLD_Implicit fields for schema version < 0.4.0
Static
POSSIBLE_Static
RESERVED_CredentialBuilder subject/claims cannot have any of these names
Static
VERSIONFollows 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.
Static
convertStatic
convertConvert schema JSON to a data URI
Optional
version: stringThe schema version. This is needed as a different conversion to JSON function was used in older version and backward compatibility is needed.
Static
convertConvert 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
Optional
rootObject: objectStatic
essentialEssential properties of a non-embedded schema.
add custom definitions as well
Static
flattenStatic
fromJSONStatic
fromJSONWithSimilar to this.fromJSON but can load an externally referenced schema if the given schema is not an embedded one.
Static
generateGenerate 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.
Static
getStatic
getStatic
isReturns true if the given object is an embedded schema, i.e. it has the properties
key set.
Static
newSame 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.
Optional
overrides: Partial<ISchemaOverrides>Static
parseStatic
parseOptional
minimum?: numberStatic
parseOptional
minimum?: numberStatic
parseOptional
minimum?: numberStatic
statusStatic
typeStatic
typeStatic
validateValidates the internal representation of schema
Static
validate
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.