This component is supposed to make a json schema instance for the transmitted values and schema.
help and support with the development very welcome :-)
https://json-schema.org/specification.html
The following example application demonstrates the usage: https://github.com/flux-caps/todo-app
account.yaml
title: account
type: object
aggregateRootNames:
- account
properties:
personId:
type: number
firstname:
type: string
lastname:
type: string
email:
type: string
type:
type: string
lastChanged:
type: string
getAndPrintSchemaInstance.php
$schema = yaml_parse(file_get_contents('account.yaml'));
$schemaInstance = fluxJsonSchemaInstance\getSchemaInstance('Emmett', $schema['properties']['firstname']);
print_r($schemaInstance);
$schemaInstance = fluxJsonSchemaInstance\getSchemaInstance('123', $schema['properties']['personId']);
print_r($schemaInstance);
outputs
Array
(
[value] => Emmett
[describedBy] => {"type":"string"}
)
Array
(
[value] => 123
[describedBy] => {"type":"number"}
)
Please ...
- ... register an account at https://git.fluxlabs.ch
- ... create pull requests 🔥
Please ...
- ... register an account at https://git.fluxlabs.ch
- ... ask us for a Service Level Agreement: [email protected] 😘
- ... read and create issues