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

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

05 Jul 2026 09:19AM UTC coverage: 17.373% (-0.1%) from 17.482%
28736035699

push

github

wol-soft
Add jsonPointer arg to unevaluated + contains exceptions

Follow-up coordination after b484f42 landed jsonPointer on every
ValidationException subclass on master: five exception classes added
after that PR on the jsonSchemaDraft2019 branch — UnevaluatedItems,
UnevaluatedProperties, RegularPropertyAsUnevaluatedProperty,
MinContains, MaxContains — still used the pre-pointer three-arg
signature. Since AbstractPropertyValidator::getExceptionParams() on
the generator side now unconditionally prepends the pointer after the
property name, those constructors rejected the call as a TypeError
whenever the corresponding validator fired.

Constructors now follow the master-side ordering: providedValue,
propertyName, jsonPointer, keyword-specific fields. The parent
ValidationException receives jsonPointer as its fourth argument, so
getJsonPointer() returns the schema keyword location that produced
the rejection (e.g. /properties/tags/unevaluatedItems).

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

0 of 15 new or added lines in 5 files covered. (0.0%)

5 existing lines in 5 files now uncovered.

168 of 967 relevant lines covered (17.37%)

0.58 hits per line

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

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

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\Exception\Object;
6

7
use PHPModelGenerator\Exception\ValidationException;
8

9
/**
10
 * Thrown when a key already declared in `properties` or matched by `patternProperties` at the
11
 * same schema level is routed through the unevaluatedProperties accessor's set() method.
12
 * Such keys belong to their own (typed) named setter or to the pattern-properties accessor;
13
 * accepting them via setUnevaluatedProperty would silently bypass the appropriate validator.
14
 */
15
class RegularPropertyAsUnevaluatedPropertyException extends ValidationException
16
{
NEW
17
    public function __construct(
×
18
        $providedValue,
19
        string $propertyName,
20
        string $jsonPointer,
21
        private readonly string $class,
22
    ) {
23
        parent::__construct(
×
24
            "Couldn't add regular property $propertyName as unevaluated property to object {$this->class}",
×
25
            $propertyName,
×
NEW
26
            $providedValue,
×
NEW
27
            $jsonPointer,
×
UNCOV
28
        );
×
29
    }
30

31
    public function getClass(): string
×
32
    {
33
        return $this->class;
×
34
    }
35
}
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