Skip to content

Commit

Permalink
LoaderExtension: finish routing validation (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar authored May 30, 2021
1 parent 884630d commit 3d8e056
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/LoaderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ final class LoaderExtension extends CompilerExtension
{
public function getConfigSchema(): Schema
{
// Expect::anyOf([
// Expect::string(), // URL
// Expect::structure([
// 'source' => Expect::string()->required(),
// 'format' => Expect::string()->required(),
// ]),
// ])->firstIsDefault()
return Expect::structure([
'basePath' => Expect::string(),
'routing' => Expect::arrayOf( // (route [*] => rules)
Expect::arrayOf( // (rule => definition)
Expect::mixed(),
Expect::anyOf(
Expect::string()->required(), // URL
Expect::structure([
'source' => Expect::string()->required(),
'format' => Expect::string()->required(),
])->castTo('array')->required(),
)->required()->firstIsDefault()
),
Expect::anyOf(Expect::string()->required()),
),
Expand Down

0 comments on commit 3d8e056

Please sign in to comment.