-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
copilotFor GitHub Copilot coding agentFor GitHub Copilot coding agent
Description
Summary
Add a PHP SDK for JSON Structure schema and instance validation.
Background
PHP powers approximately 77% of websites with a known server-side language. With Laravel, Symfony, and WordPress dominating web development, a PHP SDK provides schema validation for the massive PHP ecosystem including:
- Laravel/Symfony API validation
- WordPress plugin data validation
- Composer package ecosystem
- Legacy PHP application modernization
Implementation Guide
Follow the SDK Guidelines document: SDK-GUIDELINES.md
This document contains:
- Required components (SchemaValidator, InstanceValidator, ErrorCodes, JsonSourceLocator)
- Complete type system reference (34 primitive types + compound types)
- Keywords reference (what to implement, what NOT to implement)
- Error codes reference (assets/error-messages.json)
- Test assets for conformance testing
- Conformance checklist
Requirements
Core Features
- Schema Validation: Validate JSON Structure schema documents for conformance
- Instance Validation: Validate JSON instances against JSON Structure schemas
- Error Reporting: Line/column information for validation errors (when source JSON available)
- Full Type Support: All 34 primitive and compound types from JSON Structure Core v0
Technical Requirements
- PHP 8.1+ (for modern type system, enums, readonly properties)
- Composer for distribution
- Use json_decode() / json_encode() for JSON parsing
- PSR-4 autoloading
- PHPUnit for testing
- No framework dependencies (pure PHP, works with any framework)
Package Structure
php/
composer.json
README.md
phpunit.xml
src/
JsonStructure/
SchemaValidator.php
InstanceValidator.php
Types.php
ErrorCodes.php
JsonSourceLocator.php
ValidationResult.php
tests/
SchemaValidatorTest.php
InstanceValidatorTest.php
TestAssets.php
CI/CD
- GitHub Actions workflow with PHP matrix (8.1, 8.2, 8.3)
- Test on ubuntu-latest
- Integration with shared test-assets/ for cross-SDK validation
Reference Materials
- SDK Guidelines: SDK-GUIDELINES.md - Start here
- Error Messages: assets/error-messages.json
- Test Assets: test-assets/
- Meta-schemas: meta/
- Reference implementations: go/, rust/, typescript/, python/
Acceptance Criteria
- All test-assets pass validation
- CI workflow passes on PHP 8.1, 8.2, 8.3
- README with installation and usage examples
- Conformance checklist completed (see SDK-GUIDELINES.md)
- Published to Packagist (or ready for publication)
Copilot
Metadata
Metadata
Assignees
Labels
copilotFor GitHub Copilot coding agentFor GitHub Copilot coding agent