Skip to content
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

composer(deps): bump ergebnis/json-schema-validator from 2.0.0 to 3.0.0 #666

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`2.2.0...main`][2.2.0...main].

### Changed

- Required `ergebnis/json-schema-validator:^3.0.0` ([#666]), by [@dependabot]

## [`2.2.0`][2.2.0]

For a full diff see [`2.1.0...2.2.0`][2.1.0...2.2.0].
Expand Down Expand Up @@ -476,6 +480,7 @@ For a full diff see [`5d8b3e2...0.1.0`][5d8b3e2...0.1.0].
[#632]: https://github.com/ergebnis/json-normalizer/pull/632
[#639]: https://github.com/ergebnis/json-normalizer/pull/639
[#641]: https://github.com/ergebnis/json-normalizer/pull/641
[#666]: https://github.com/ergebnis/json-normalizer/pull/666

[@BackEndTea]: https://github.com/BackEndTea
[@dependabot]: https://github.com/dependabot
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -23,7 +23,7 @@
"ext-json": "*",
"ergebnis/json-pointer": "^2.1.0",
"ergebnis/json-printer": "^3.2.0",
"ergebnis/json-schema-validator": "^2.0.0",
"ergebnis/json-schema-validator": "^3.0.0",
"justinrainbow/json-schema": "^5.2.11"
},
"require-dev": {
Expand Down
29 changes: 15 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/SchemaNormalizer.php
Expand Up @@ -13,6 +13,7 @@

namespace Ergebnis\Json\Normalizer;

use Ergebnis\Json\Pointer;
use Ergebnis\Json\SchemaValidator;
use JsonSchema\Exception\InvalidSchemaMediaTypeException;
use JsonSchema\Exception\JsonDecodingException;
Expand Down Expand Up @@ -53,7 +54,7 @@ public function normalize(Json $json): Json
$resultBeforeNormalization = $this->schemaValidator->validate(
SchemaValidator\Json::fromString($json->encoded()),
SchemaValidator\Json::fromString(\json_encode($schema)),
SchemaValidator\JsonPointer::empty(),
Pointer\JsonPointer::document(),
);

if (!$resultBeforeNormalization->isValid()) {
Expand All @@ -73,7 +74,7 @@ public function normalize(Json $json): Json
$resultAfterNormalization = $this->schemaValidator->validate(
SchemaValidator\Json::fromString($normalized->encoded()),
SchemaValidator\Json::fromString(\json_encode($schema)),
SchemaValidator\JsonPointer::empty(),
Pointer\JsonPointer::document(),
);

if (!$resultAfterNormalization->isValid()) {
Expand Down Expand Up @@ -238,7 +239,7 @@ private function resolveSchema(
$result = $this->schemaValidator->validate(
SchemaValidator\Json::fromString(\json_encode($data)),
SchemaValidator\Json::fromString(\json_encode($anyOfSchema)),
SchemaValidator\JsonPointer::empty(),
Pointer\JsonPointer::document(),
);

if ($result->isValid()) {
Expand All @@ -261,7 +262,7 @@ private function resolveSchema(
$result = $this->schemaValidator->validate(
SchemaValidator\Json::fromString(\json_encode($data)),
SchemaValidator\Json::fromString(\json_encode($oneOfSchema)),
SchemaValidator\JsonPointer::empty(),
Pointer\JsonPointer::document(),
);

if ($result->isValid()) {
Expand Down