-
-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Milestone
Description
Predefined schema is very powerful mechanism that can reduce a lot reading/writing datasets, but in order to make it even more usable we should allow to save/read schema from associative arrays which can be turned into json/xml/yaml/whatver.
Two things are a bit problematic here, but I think we can simplify them.
- Constraints - this mechanism was pretty much replaced by introducing types so I think we can safely remove Schema Definition Constraints
- Metadata - I would keep metadata but I would remove possibility of putting objects into it.
That should give us following API:
Schema::toArray() : array
Schema::fromArray() : array
Which can be later used to create:
schema_from_json(string $schema) : Schemaschema_to_json(Schema $schema) : string