Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

KnpLabs/muse

Repository files navigation

DEPRECATED

Unfortunately we decided to not maintain this project anymore (see why). If you want to mark another package as a replacement for this one please send an email to hello@knplabs.com.

Muse

Build Status

The Muse inspires itself from a JSON Schema (only wth JSON Schema v4 for now) to generate a valid JSON.

Usage

$schema = <<<SCHEMA
{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    }
  }
}
SCHEMA;


echo "Dumb data provider\n";
echo \Muse\MuseFactory::createDumbMuse()->inspire($schema);

echo "\n\n";
echo "Random data provider\n";
echo \Muse\MuseFactory::createRandomMuse()->inspire($schema);

will output:

Dumb data provider
{
    "id": 1,
    "name": "foo"
}

Random data provider
{
    "id": 1634388030,
    "name": "ajkvu5xpepkwwc04skkw4wgs0s4ok48"
}

About

Inspires some JSON data basing itself on a JSON schema

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages