scedel/schema
最新稳定版本:0.2.1
Composer 安装命令:
composer require scedel/schema
包简介
Typed schema repository builder for Scedel
README 文档
README
Intermediate layer between scedel/parser AST and downstream packages (validator/codegen).
RFC support
What it provides
- Recursive include loading (DFS include-first)
- Include cycle detection
- Diamond include graphs (shared canonical targets are loaded once)
- Warnings for direct duplicate includes in a single file
- Type merge (
type expr+ annotation-only declarations) - Validator merge by
(targetType, name)with strict structural duplicate checks - Immutable
SchemaRepositorywith types, validators, annotation trees, and document include graph
Usage
use Scedel\Parser\ParserService; use Scedel\Schema\Infrastructure\FilesystemIncludeResolver; use Scedel\Schema\Infrastructure\FilesystemSourceLoader; use Scedel\Schema\RepositoryBuilder; $builder = new RepositoryBuilder( new ParserService(), new FilesystemIncludeResolver(), new FilesystemSourceLoader(), ); $repository = $builder->buildFromFile('/absolute/path/schema.scedel'); $type = $repository->getType('Post'); $validator = $repository->getValidator('String', 'noAds');
buildFromString() supports includes if baseUri is provided.
$repository = $builder->buildFromString( $source, 'inline.scedel', 'file:///absolute/path/inline.scedel', );
Schema info utility
Print human-readable schema info (version, documents/includes, types with constraints, validators, annotations):
php bin/describe-schema.php /absolute/path/schema.scedel
Include builtin types/validators in output:
php bin/describe-schema.php --show-builtins /absolute/path/schema.scedel
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-18