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

wol-soft / php-json-schema-model-generator / 23453430579
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: refImprovements
DEFAULT BRANCH: master
Ran 23 Mar 2026 06:25PM UTC
Jobs 1
Files 133
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Mar 2026 06:23PM UTC coverage: 98.58% (-0.02%) from 98.604%
23453430579

push

github

Enno Woortmann
Fix issue #98: wrong type hint and broken validation for nested object properties with anyOf/oneOf

When a nested object property has anyOf/oneOf whose branches add only constraints
(required, minProperties, maxProperties, patternProperties) rather than new named
properties, two bugs manifested:

1. The getter @return annotation referenced a generated _Merged_ class instead of
   the correct nested object class.
2. Valid inputs were wrongly rejected by an AnyOfException thrown at the parent
   schema level.

Root cause: AbstractPropertyProcessor::addComposedValueValidator was called for
non-root type:object properties, producing a duplicate composition validator at
the parent level. By the time this validator runs, the property value is already
an instantiated object, so branch instanceof checks against branch-specific classes
fail. It also injected the _Merged_ class name as a type hint decorator, overriding
the correct type set by ObjectProcessor.

Fix 1: Skip addComposedValueValidator entirely for non-root type:object properties.
ObjectProcessor already handles composition inside the nested schema via processSchema
with rootLevelComposition=true, so the parent-level duplication is unnecessary.

Fix 2: CompositionValidationPostProcessor was conditionally skipping method generation
when composition branches had no named properties (e.g. minProperties/maxProperties
branches). The validateComposition_N call was still emitted by the template, causing
a fatal "call to undefined method" error at runtime. The post-processor now always
generates validation methods for all composition validators in baseValidators, and
only skips setter-hook wiring when there are no trackable properties.

9 of 10 new or added lines in 2 files covered. (90.0%)

3889 of 3945 relevant lines covered (98.58%)

553.63 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
98.57
-1.43% src/SchemaProcessor/PostProcessor/Internal/CompositionValidationPostProcessor.php
Jobs
ID Job ID Ran Files Coverage
1 Unit - 23453430579.1 23 Mar 2026 06:25PM UTC 133
98.58
GitHub Action Run
Source Files on build 23453430579
  • Tree
  • List 133
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23453430579
  • abb6f501 on github
  • Prev Build on chore/phpunit-13-upgrade (#23445961691)
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