Skip to content

Schema to/from Array #932

@norberttech

Description

@norberttech

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) : Schema
  • schema_to_json(Schema $schema) : string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions