flux-eco / json-schema-document
由fluxlabs开发的flux-capacitor应用的组件
1.0.1
2022-04-08 20:16 UTC
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- ext-yaml: *
Requires (Dev)
- swoole/ide-helper: >=4.6
README
此组件旨在通过提供通过PHP读取某些元素的方法,使json文档更具可读性。
非常欢迎帮助和支持开发 :-)
https://json-schema.fullstack.org.cn/specification.html
以下示例应用程序演示了用法: https://github.com/flux-caps/todo-app
功能用法
account.yaml
title: account
type: object
aggregateRootNames:
- account
properties:
personId:
type: integer
firstname:
type: string
lastname:
type: string
email:
type: string
type:
type: string
lastChanged:
type: string
getAndPrintSchemaDocument.php
$schemaDocument = fluxJsonSchemaDocument\getSchemaDocument('account.yaml');
print_r($schemaDocument);
输出
Array
FluxEco\JsonSchemaDocument\SchemaDocument Object
(
[schemaDocument:FluxEco\JsonSchemaDocument\SchemaDocument:private] => FluxEco\JsonSchemaDocument\Core\Domain\SchemaDocument Object
(
[title:FluxEco\JsonSchemaDocument\Core\Domain\SchemaDocument:private] => account
[properties:FluxEco\JsonSchemaDocument\Core\Domain\SchemaDocument:private] => Array
(
[personId] => FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject Object
(
[key:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => personId
[type:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => integer
)
[firstname] => FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject Object
(
[key:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => firstname
[type:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => string
)
[lastname] => FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject Object
(
[key:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => lastname
[type:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => string
)
[email] => FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject Object
(
[key:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => email
[type:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => string
)
[type] => FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject Object
(
[key:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => type
[type:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => string
)
[lastChanged] => FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject Object
(
[key:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => lastChanged
[type:FluxEco\JsonSchemaDocument\Core\Domain\Models\SchemaObject:private] => string
)
)
)
)
贡献 💜
请...
- ...在https://git.fluxlabs.ch注册账户
- ...创建pull请求 🔥
调整建议/错误报告 🐾
请...
- ...在https://git.fluxlabs.ch注册账户
- ...向我们要求服务水平协议: support@fluxlabs.ch 😘
- ...阅读和创建问题