PHP Package: opis/json-schema
Opis JSON Schema is a powerful PHP library for validating JSON data against a schema definition.
Current Version: 2.5.0
Last Updated: 2025-10-08
PHP Requirement: ^7.4 || ^8.0
Dependencies:
opis/json
opis/json
⚠️ To ensure full functionality, the above dependencies might be required.
Package Description
Opis JSON Schema is a comprehensive PHP library designed for validating JSON data structures against a predefined schema. It provides an intuitive way to enforce data consistency and ensure compliance with specified rules. With support for complex validation scenarios and error handling, Opis JSON Schema simplifies the process of validating JSON data efficiently and effectively.
Classes:
- Opis\JsonSchema\ContentMediaType
- Opis\JsonSchema\Schemas\LazySchema
- Opis\JsonSchema\Schemas\BooleanSchema
- Opis\JsonSchema\Schemas\ExceptionSchema
- Opis\JsonSchema\Schemas\ObjectSchema
- Opis\JsonSchema\Schemas\AbstractSchema
- Opis\JsonSchema\Schemas\EmptySchema
- Opis\JsonSchema\SchemaValidator
- Opis\JsonSchema\Uri
- Opis\JsonSchema\KeywordValidator
- Opis\JsonSchema\Validator
- Opis\JsonSchema\Variables
- Opis\JsonSchema\ContentEncoding
- Opis\JsonSchema\Resolvers\ContentMediaTypeResolver
- Opis\JsonSchema\Resolvers\FilterResolver
- Opis\JsonSchema\Resolvers\SchemaResolver
- Opis\JsonSchema\Resolvers\FormatResolver
- Opis\JsonSchema\Resolvers\ContentEncodingResolver
- Opis\JsonSchema\Format
- Opis\JsonSchema\Pragma
- Opis\JsonSchema\SchemaLoader
- Opis\JsonSchema\Exceptions\DuplicateSchemaIdException
- Opis\JsonSchema\Exceptions\ParseException
- Opis\JsonSchema\Exceptions\UnresolvedContentMediaTypeException
- Opis\JsonSchema\Exceptions\InvalidKeywordException
- Opis\JsonSchema\Exceptions\UnresolvedException
- Opis\JsonSchema\Exceptions\UnresolvedFilterException
- Opis\JsonSchema\Exceptions\UnresolvedReferenceException
- Opis\JsonSchema\Exceptions\InvalidPragmaException
- Opis\JsonSchema\Exceptions\SchemaException
- Opis\JsonSchema\Exceptions\UnresolvedContentEncodingException
- Opis\JsonSchema\ValidationResult
- Opis\JsonSchema\Filter
- Opis\JsonSchema\Info\DataInfo
- Opis\JsonSchema\Info\SchemaInfo
- Opis\JsonSchema\Errors\ErrorFormatter
- Opis\JsonSchema\Errors\CustomError
- Opis\JsonSchema\Errors\ValidationError
- Opis\JsonSchema\Errors\ErrorContainer
- Opis\JsonSchema\Keyword
- Opis\JsonSchema\KeywordValidators\PragmaKeywordValidator
- Opis\JsonSchema\KeywordValidators\AbstractKeywordValidator
- Opis\JsonSchema\KeywordValidators\CallbackKeywordValidator
- Opis\JsonSchema\Pragmas\MaxErrorsPragma
- Opis\JsonSchema\Pragmas\CastPragma
- Opis\JsonSchema\Pragmas\SlotsPragma
- Opis\JsonSchema\Pragmas\GlobalsPragma
- Opis\JsonSchema\ValidationContext
- Opis\JsonSchema\Formats\DateTimeFormats
- Opis\JsonSchema\Formats\IriFormats
- Opis\JsonSchema\Formats\MiscFormats
- Opis\JsonSchema\Formats\UriFormats
- Opis\JsonSchema\Schema
- Opis\JsonSchema\CompliantValidator
- Opis\JsonSchema\Parsers\ResolverTrait
- Opis\JsonSchema\Parsers\DataKeywordTrait
- Opis\JsonSchema\Parsers\KeywordParser
- Opis\JsonSchema\Parsers\PragmaParser
- Opis\JsonSchema\Parsers\KeywordParserTrait
- Opis\JsonSchema\Parsers\KeywordValidatorParser
- Opis\JsonSchema\Parsers\KeywordValidators\PragmaKeywordValidatorParser
- Opis\JsonSchema\Parsers\DraftOptionTrait
- Opis\JsonSchema\Parsers\Pragmas\GlobalsPragmaParser
- Opis\JsonSchema\Parsers\Pragmas\MaxErrorsPragmaParser
- Opis\JsonSchema\Parsers\Pragmas\SlotsPragmaParser
- Opis\JsonSchema\Parsers\Pragmas\CastPragmaParser
- Opis\JsonSchema\Parsers\DefaultVocabulary
- Opis\JsonSchema\Parsers\Keywords\AdditionalPropertiesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\NotKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ContentEncodingKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MultipleOfKeywordParser
- Opis\JsonSchema\Parsers\Keywords\DependentSchemasKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MaxItemsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\TypeKeywordParser
- Opis\JsonSchema\Parsers\Keywords\DefaultKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MaxLengthKeywordParser
- Opis\JsonSchema\Parsers\Keywords\PatternKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MinimumKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ItemsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\DependentRequiredKeywordParser
- Opis\JsonSchema\Parsers\Keywords\AllOfKeywordParser
- Opis\JsonSchema\Parsers\Keywords\AdditionalItemsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\RefKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ExclusiveMaximumKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ContainsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\RequiredKeywordParser
- Opis\JsonSchema\Parsers\Keywords\FiltersKeywordParser
- Opis\JsonSchema\Parsers\Keywords\DependenciesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ContentMediaTypeKeywordParser
- Opis\JsonSchema\Parsers\Keywords\SlotsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\UnevaluatedItemsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\UnevaluatedPropertiesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\UniqueItemsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\PropertiesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\FormatKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MinLengthKeywordParser
- Opis\JsonSchema\Parsers\Keywords\EnumKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ExclusiveMinimumKeywordParser
- Opis\JsonSchema\Parsers\Keywords\OneOfKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MaximumKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ContentSchemaKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MaxPropertiesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\IfThenElseKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MinItemsKeywordParser
- Opis\JsonSchema\Parsers\Keywords\PatternPropertiesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\PropertyNamesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\MinPropertiesKeywordParser
- Opis\JsonSchema\Parsers\Keywords\ConstKeywordParser
- Opis\JsonSchema\Parsers\Keywords\AnyOfKeywordParser
- Opis\JsonSchema\Parsers\Vocabulary
- Opis\JsonSchema\Parsers\SchemaParser
- Opis\JsonSchema\Parsers\Draft
- Opis\JsonSchema\Parsers\Drafts\Draft07
- Opis\JsonSchema\Parsers\Drafts\Draft201909
- Opis\JsonSchema\Parsers\Drafts\Draft06
- Opis\JsonSchema\Parsers\Drafts\Draft202012
- Opis\JsonSchema\Parsers\VariablesTrait
- Opis\JsonSchema\Keywords\NotKeyword
- Opis\JsonSchema\Keywords\DependentSchemasKeyword
- Opis\JsonSchema\Keywords\IfThenElseKeyword
- Opis\JsonSchema\Keywords\DependentRequiredKeyword
- Opis\JsonSchema\Keywords\AllOfKeyword
- Opis\JsonSchema\Keywords\MaxLengthDataKeyword
- Opis\JsonSchema\Keywords\MaxPropertiesKeywords
- Opis\JsonSchema\Keywords\RequiredKeyword
- Opis\JsonSchema\Keywords\DependenciesKeyword
- Opis\JsonSchema\Keywords\MinPropertiesDataKeyword
- Opis\JsonSchema\Keywords\UnevaluatedItemsKeyword
- Opis\JsonSchema\Keywords\ContentMediaTypeKeyword
- Opis\JsonSchema\Keywords\PropertyNamesKeyword
- Opis\JsonSchema\Keywords\MaxLengthKeyword
- Opis\JsonSchema\Keywords\MaxItemsKeyword
- Opis\JsonSchema\Keywords\SlotsKeyword
- Opis\JsonSchema\Keywords\AbstractRefKeyword
- Opis\JsonSchema\Keywords\MaxItemsDataKeyword
- Opis\JsonSchema\Keywords\MaximumDataKeyword
- Opis\JsonSchema\Keywords\ExclusiveMinimumDataKeyword
- Opis\JsonSchema\Keywords\EnumDataKeyword
- Opis\JsonSchema\Keywords\DefaultKeyword
- Opis\JsonSchema\Keywords\MultipleOfKeyword
- Opis\JsonSchema\Keywords\MinLengthKeyword
- Opis\JsonSchema\Keywords\ItemsKeyword
- Opis\JsonSchema\Keywords\ErrorTrait
- Opis\JsonSchema\Keywords\EnumKeyword
- Opis\JsonSchema\Keywords\UnevaluatedPropertiesKeyword
- Opis\JsonSchema\Keywords\PatternPropertiesKeyword
- Opis\JsonSchema\Keywords\FormatKeyword
- Opis\JsonSchema\Keywords\ConstDataKeyword
- Opis\JsonSchema\Keywords\RecursiveRefKeyword
- Opis\JsonSchema\Keywords\UniqueItemsKeyword
- Opis\JsonSchema\Keywords\TypeKeyword
- Opis\JsonSchema\Keywords\RequiredDataKeyword
- Opis\JsonSchema\Keywords\TemplateRefKeyword
- Opis\JsonSchema\Keywords\FiltersKeyword
- Opis\JsonSchema\Keywords\AdditionalItemsKeyword
- Opis\JsonSchema\Keywords\MinItemsKeyword
- Opis\JsonSchema\Keywords\PatternKeyword
- Opis\JsonSchema\Keywords\ContentSchemaKeyword
- Opis\JsonSchema\Keywords\FormatDataKeyword
- Opis\JsonSchema\Keywords\MaximumKeyword
- Opis\JsonSchema\Keywords\UniqueItemsDataKeyword
- Opis\JsonSchema\Keywords\OfTrait
- Opis\JsonSchema\Keywords\ContentEncodingKeyword
- Opis\JsonSchema\Keywords\ExclusiveMaximumKeyword
- Opis\JsonSchema\Keywords\OneOfKeyword
- Opis\JsonSchema\Keywords\AnyOfKeyword
- Opis\JsonSchema\Keywords\PropertiesKeyword
- Opis\JsonSchema\Keywords\URIRefKeyword
- Opis\JsonSchema\Keywords\MaxPropertiesDataKeyword
- Opis\JsonSchema\Keywords\ExclusiveMinimumKeyword
- Opis\JsonSchema\Keywords\IterableDataValidationTrait
- Opis\JsonSchema\Keywords\ContainsKeyword
- Opis\JsonSchema\Keywords\MinimumKeyword
- Opis\JsonSchema\Keywords\MinItemsDataKeyword
- Opis\JsonSchema\Keywords\ExclusiveMaximumDataKeyword
- Opis\JsonSchema\Keywords\MinimumDataKeyword
- Opis\JsonSchema\Keywords\ConstKeyword
- Opis\JsonSchema\Keywords\MultipleOfDataKeyword
- Opis\JsonSchema\Keywords\PointerRefKeyword
- Opis\JsonSchema\Keywords\AdditionalPropertiesKeyword
- Opis\JsonSchema\Keywords\PatternDataKeyword
- Opis\JsonSchema\Keywords\MinLengthDataKeyword
- Opis\JsonSchema\Keywords\MinPropertiesKeyword
- Opis\JsonSchema\JsonPointer
- Opis\JsonSchema\Helper
- Opis\JsonSchema\Variables\RefVariablesContainer
- Opis\JsonSchema\Variables\VariablesContainer
- Opis\JsonSchema\Filters\DataExistsFilter
- Opis\JsonSchema\Filters\GlobalVarExistsFilter
- Opis\JsonSchema\Filters\DateTimeFilters
- Opis\JsonSchema\Filters\FilterExistsFilter
- Opis\JsonSchema\Filters\SlotExistsFilter
- Opis\JsonSchema\Filters\CommonFilters
- Opis\JsonSchema\Filters\FormatExistsFilter
- Opis\JsonSchema\Filters\SchemaExistsFilter
Download Latest Version: 2.5.0

Previous Versions
Code Integration Example
Make sure to include the correct namespace and class paths for proper usage.
<?php
// Example from PHPlibraries.com
require_once 'libs/opis/json-schema/2.5.0/loader.php';
require_once 'libs/opis/json/{lib_version}/loader.php';
use Opis\JsonSchema\Validator;
$obj = new Validator();
echo '✅ Test OK: ' . get_class($obj);
?>
We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.
Community Discussion
Ask questions, share tips, or report issues below.