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

Fix: Description #648

Merged
merged 1 commit into from Jan 22, 2022
Merged
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
20 changes: 17 additions & 3 deletions README.md
Expand Up @@ -263,7 +263,7 @@ Let's assume the following schema
```json
{
"type": "object",
"additionalProperties": false,
"additionalProperties": true,
"properties": {
"name" : {
"type" : "string"
Expand All @@ -287,7 +287,21 @@ use JsonSchema\SchemaStorage;
$encoded = <<<'JSON'
{
"url": "https://localheinz.com",
"name": "Andreas Möller"
"name": "Andreas Möller",
"open-source-projects": {
"ergebnis/composer-normalize":
"downloads": {
"total": 5,
"monthly": 2
},
},
"ergebnis/data-provider": {
"downloads": {
"total": 2,
"monthly": 1
}
}
}
}
JSON;

Expand All @@ -302,7 +316,7 @@ $normalizer = new Normalizer\SchemaNormalizer(
$normalized = $normalizer->normalize($json);
```

The normalized version will now be structured according to the JSON schema (in this simple case, properties will be reordered). Internally, the `SchemaNormalizer` uses [`justinrainbow/json-schema`](https://github.com/justinrainbow/json-schema) to resolve schemas, as well as to ensure (before and after normalization) that the JSON document is valid.
The normalized version will now be structured according to the JSON schema (in this simple case, properties will be reordered as found in the schema and additional properties will be ordered by name). Internally, the `SchemaNormalizer` uses [`justinrainbow/json-schema`](https://github.com/justinrainbow/json-schema) to resolve schemas, as well as to ensure (before and after normalization) that the JSON document is valid.

:bulb: For more information about JSON schema, visit [json-schema.org](http://json-schema.org).

Expand Down