Skip to content

Commit

Permalink
Fix JSON schema regex pattern (#10811)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger authored Jun 1, 2022
1 parent 313142c commit 70a7b59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion res/composer-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": {
"type": "string",
"description": "Package name, including 'vendor-name/' prefix.",
"pattern": "^[a-z0-9]([_.-]?[a-z0-9]++)*+\/[a-z0-9](([_.]|-{1,2})?[a-z0-9]++)*+$"
"pattern": "^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$"
},
"description": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions tests/Composer/Test/Json/ComposerSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public function testNamePattern()
$expectedError = array(
array(
'property' => 'name',
'message' => 'Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]++)*+/[a-z0-9](([_.]|-{1,2})?[a-z0-9]++)*+$',
'message' => 'Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$',
'constraint' => 'pattern',
'pattern' => '^[a-z0-9]([_.-]?[a-z0-9]++)*+/[a-z0-9](([_.]|-{1,2})?[a-z0-9]++)*+$',
'pattern' => '^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$',
),
);

Expand Down

0 comments on commit 70a7b59

Please sign in to comment.