Skip to content

Commit

Permalink
Merge branch 'default-additional-properties-fix' of https://github.co…
Browse files Browse the repository at this point in the history
…m/Tayfun74/core into default-additional-properties-fix
  • Loading branch information
Tayfun74 committed Dec 10, 2020
2 parents 273db10 + 77b7d3e commit 8baa188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JsonSchema/SchemaFactory.php
Expand Up @@ -118,7 +118,7 @@ public function buildSchema(string $className, string $format = 'json', string $

// additionalProperties are allowed by default, so it does not need to be set explicitly, unless allow_extra_attributes is false
// See https://json-schema.org/understanding-json-schema/reference/object.html#properties
if (isset($serializerContext[AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES]) && false === $serializerContext[AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES]) {
if (false === ($serializerContext[AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES] ?? true)) {
$definition['additionalProperties'] = false;
}

Expand Down

0 comments on commit 8baa188

Please sign in to comment.