Skip to content

Update UPGRADE-6.0.md #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fix objects are non-unique despite key order ([#819](https://github.com/jsonrainbow/json-schema/pull/819))

### Changed
- Added extra breaking change to UPDATE-6.0.md regarding BaseConstraint::addError signature change ([#823](https://github.com/jsonrainbow/json-schema/pull/823)

## [6.4.1] - 2025-04-04
### Fixed
- Fix support for 32bits PHP ([#817](https://github.com/jsonrainbow/json-schema/pull/817))
Expand Down
20 changes: 19 additions & 1 deletion UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,22 @@ Thank you for your support and contributions to the project.
foreach ($validator->getErrors() as $error) {
echo $error['constraint']['name']; // required
}
```
```

## BaseConstraint::addError signature changed

* The signature for the `BaseConstraint::AddError` method has changed.

The `$message` parameter has been removed and replaced by the `ConstraintError` parameter.
The `ConstraintError` object encapsulates the error message along with additional information about the constraint violation.

*Before*
```php
public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null)
```

*After*
```php
public function addError(ConstraintError $constraint, ?JsonPointer $path = null, array $more = []): void
```

Loading