Closed abdullahseba closed 7 years ago
Are you thinking that this should happen automatically for schema of the same name in each Sprinkle? Or is this something that you should have to do explicitly?
Automatically I guess.
I am going to leave the default behavior for now, to only load the version of a request schema in the most recently loaded Sprinkle. However, you can still directly extend schema with arrays (see #1), OR you may use the StreamPathBuilder
to load paths to all versions of your schema file, and YamlFileLoader
to automatically merge the together:
$builder = new StreamPathBuilder($this->ci->locator, 'schema://contact.yaml');
$loader = new YamlFileLoader($builder->buildPaths());
$schema = new RequestSchemaRepository($loader->load());
You can also write a custom PathBuilder
or FileRepositoryLoader
to find and combine schema in whatever manner you see fit.
Allow schemas to be extended from other sprinkles without overriding the original schema.