Skip to content

Commit

Permalink
fix mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
tymondesigns committed Jan 20, 2025
1 parent c9e6b3f commit ac6da7c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ $schema = SchemaFactory::object('user')
->default(true),
SchemaFactory::object('settings')
->additionalProperties(false)
->properties([
->properties(
SchemaFactory::string('theme')
->enum(['light', 'dark']),
]),
),
);
```

Expand Down Expand Up @@ -571,7 +571,7 @@ $schema = SchemaFactory::object('user')

// allOf - all schemas must match
$schema = SchemaFactory::object()
->allOf([
->allOf(
SchemaFactory::object()
->properties(
SchemaFactory::string('name')->required(),
Expand All @@ -582,11 +582,11 @@ $schema = SchemaFactory::object()
->minimum(18)
->required(),
),
]);
);

// anyOf - at least one schema must match
$schema = SchemaFactory::object('payment')
->anyOf([
->anyOf(
SchemaFactory::object()
->properties(
SchemaFactory::string('credit_card')
Expand All @@ -599,11 +599,11 @@ $schema = SchemaFactory::object('payment')
->pattern('^\w{8,}$')
->required(),
),
]);
);

// oneOf - exactly one schema must match
$schema = SchemaFactory::object('contact')
->oneOf([
->oneOf(
SchemaFactory::object()
->properties(
SchemaFactory::string('email')
Expand All @@ -616,7 +616,7 @@ $schema = SchemaFactory::object('contact')
->pattern('^\+\d{10,}$')
->required(),
),
]);
);

// not - schema must not match
$schema = SchemaFactory::string('status')
Expand Down

0 comments on commit ac6da7c

Please sign in to comment.