Skip to content

Commit 9228e0b

Browse files
Organize SCHEMA_KEYWORDS by category for maintainability
Reorganize the schema keywords array into logical categories (core identifiers, type/structure, validation, composition, metadata) for better readability and maintainability. Co-authored-by: DannyvdSluijs <618940+DannyvdSluijs@users.noreply.github.com>
1 parent 889f303 commit 9228e0b

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/JsonSchema/SchemaStorage.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,25 @@ class SchemaStorage implements SchemaStorageInterface
2222
* The properties *container* (the value) won't have these keywords, so it won't match.
2323
*/
2424
private const SCHEMA_KEYWORDS = [
25-
'type', 'properties', 'items', 'additionalProperties', 'additionalItems',
26-
'required', 'allOf', 'anyOf', 'oneOf', 'not', 'format',
27-
'minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum',
28-
'minLength', 'maxLength', 'pattern', 'minItems', 'maxItems',
29-
'uniqueItems', 'minProperties', 'maxProperties', 'multipleOf',
25+
// Core schema identifiers
3026
'$schema', 'id', '$id', 'title', 'description',
31-
'default', 'examples', 'patternProperties', 'dependencies'
27+
28+
// Type and structure
29+
'type', 'properties', 'patternProperties', 'additionalProperties',
30+
'items', 'additionalItems', 'required', 'dependencies',
31+
32+
// Validation keywords
33+
'format', 'pattern',
34+
'minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf',
35+
'minLength', 'maxLength',
36+
'minItems', 'maxItems', 'uniqueItems',
37+
'minProperties', 'maxProperties',
38+
39+
// Composition
40+
'allOf', 'anyOf', 'oneOf', 'not',
41+
42+
// Metadata
43+
'default', 'examples'
3244
];
3345

3446
protected $uriRetriever;

0 commit comments

Comments
 (0)