Schema Verification Policy Reference

This reference documents the schema verification policy for the verifier service. The schema policy validates that credential content conforms to defined schemas, ensuring data integrity and structural correctness.

Policy Overview

The schema verification policy validates the content of verifiable credentials against defined schemas to ensure the credential data adheres to expected structure and data types. This validation ensures credentials contain properly formatted data and helps maintain interoperability between different systems.

Supported Standards

The schema verification policy supports credential schema validation across multiple standards:

StandardOrganizationSpecificationSchema FormatValidation Aspect
JSON SchemaIETFJSON SchemaJSON SchemaProvides underlying schema validation technology for credential data
JSON-LD Context ValidationW3CJSON-LD 1.1JSON-LD ContextValidates against semantic data models defined in JSON-LD contexts
SD-JWT Verifiable CredentialIETFSD-JWT DraftJWT ClaimsValidates JWT and SD-JWT claims against defined schemas
Verifiable Credentials JSON SchemaW3CVC JSON SchemaJSON SchemaValidates credential claims against standard JSON Schema

Supported Schema Formats

The verifier supports the following credential schema validation implementations:

Schema FormatDescriptionSpecificationBest For
W3C Verifiable Credential SchemaSchema validation for W3C VCsW3C RecommendationW3C VC validation using JSON Schema or JSON-LD Context
IETF Digital Credential SchemaSchema validation for IETF credentialsIETF DraftSD-JWT and JWT credential validation

Schema Verification Process

When verifying against schemas, the policy follows these steps:

  1. Type extraction - Identifies the credential type and associated schema
  2. Schema resolution - Retrieves the schema from a schema registry or URI
  3. Content validation - Validates the credential data against the schema
  4. Result determination - Returns the validation result with any schema violations

Integration with Schema Registry

The schema policy integrates with schema registry services to:

  1. Discover schemas based on credential types
  2. Fetch schema definitions from URIs
  3. Cache frequently used schemas for improved performance
  4. Support versioned schemas for credential evolution

Error Handling

The schema policy returns specific errors for various validation failures:

Error TypeDescriptionTypical Cause
Schema Not FoundCannot locate schema for validationMissing or invalid schema reference
Schema Resolution ErrorError retrieving schema from URINetwork issues or invalid schema URI
Validation ErrorCredential fails to validate against schemaMalformed credential data
Invalid SchemaSchema definition is invalidPoorly structured schema
Unsupported Schema TypeSchema format not supportedSchema uses unsupported validation mechanism

Configuration

The schema verification policy offers various configuration options that control its behavior, including:

  • Enabling or disabling schema validation
  • Configuring schema resolution mechanisms
  • Setting validation behavior for missing schemas
  • Controlling error handling for validation failures
  • Schema caching settings

For detailed configuration options, parameters, and default values, see the Verifier Configuration Reference.