• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wol-soft / php-json-schema-model-generator-production / 26912150489

03 Jun 2026 03:54PM UTC coverage: 19.622% (-2.4%) from 22.013%
26912150489

push

github

wol-soft
Add unevaluatedProperties runtime support

Adds the runtime exceptions thrown by the generated unevaluatedProperties
validator (UnevaluatedPropertiesException for the `false`-form,
InvalidUnevaluatedPropertiesException for the schema-form) and a
collectUnevaluatedKeys() method on CompositionEvaluationTrait that the
generated validators call.

The method computes the list of model-data keys not evaluated by any
local applicator or successful sibling composition branch, consulting
the typed slot values in _compositionEvaluations (null, true, string[],
or nested-schema instance) recorded by the composition tracking pass.

The generator skips emitting the validator when the same schema declares
a non-false additionalProperties, so this method does not need to handle
that shortcut at runtime.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

0 of 40 new or added lines in 2 files covered. (0.0%)

35 existing lines in 1 file now uncovered.

166 of 846 relevant lines covered (19.62%)

0.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Exception/Object/UnevaluatedPropertiesException.php
1
<?php
2

3
declare(strict_types = 1);
4

5
namespace PHPModelGenerator\Exception\Object;
6

7
use PHPModelGenerator\Exception\ValidationException;
8

9
/**
10
 * Class UnevaluatedPropertiesException
11
 *
12
 * @package PHPModelGenerator\Exception\Object
13
 */
14
class UnevaluatedPropertiesException extends ValidationException
15
{
16
    /** @var string[] */
17
    protected $unevaluatedProperties;
18

19
    /**
20
     * UnevaluatedPropertiesException constructor.
21
     *
22
     * @param $providedValue
23
     * @param string $propertyName
24
     * @param string[] $unevaluatedProperties
25
     */
NEW
26
    public function __construct($providedValue, string $propertyName, array $unevaluatedProperties)
×
27
    {
NEW
28
        $this->unevaluatedProperties = $unevaluatedProperties;
×
29

NEW
30
        parent::__construct(
×
NEW
31
            "Provided JSON for $propertyName contains not allowed unevaluated properties [" .
×
NEW
32
                join(", ", $unevaluatedProperties) . ']',
×
NEW
33
            $propertyName,
×
NEW
34
            $providedValue
×
NEW
35
        );
×
36
    }
37

38
    /**
39
     * @return string[]
40
     */
NEW
41
    public function getUnevaluatedProperties(): array
×
42
    {
NEW
43
        return $this->unevaluatedProperties;
×
44
    }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc