jsonschema 4.18 deprecated the in-tree RefResolver and routes cross-file
$ref resolution through the new referencing library. It also inlined
Validator.descend so it no longer goes through iter_errors, which
breaks the recipe's collect-defaults / unstringify scheme that relies on
seeing every descended sub-schema. Without this fix bumping jsonschema
above 4.17.x causes 40 errors + 18 silent failures in the JsonSchema*
test classes (PointerToNowhere on cross-file $ref, plus defaults and
unstringification silently noop'ing).
The fix is gated on a runtime detection of referencing so older
Python 2 / jsonschema 3.0.2 environments keep working unchanged:
- Build a
referencing.Registry(retrieve=...)driven bySoftwareReleaseSchema._readAsJsonto lazily load sibling schema files; pass it via a newregistry=kwarg onDefaultValidatorand forward it to the validator constructor invalidate(). - Add helpers (
_capture_scope,_apply_scope,_resolver_of) that switch betweenvalidator.resolver.base_uri/push_scope(RefResolver) andvalidator._resolver/evolve(_resolver=...)(referencing.Resolver). Use them initer_errors,memoize_defaults,collect_defaults,apply_unstringify,fetch_key. - Re-route
kls.descendthroughevolved.iter_errors(instance)on jsonschema >= 4.18 so the recipe's iter_errors wrapper observes every sub-schema descent again.
stack/slapos.cfg: bump jsonschema 4.17.3 -> 4.23.0 and pin its new transitive deps (referencing, jsonschema-specifications, rpds-py) so the stack can carry the new resolver chain. Wheel-only because rpds-py builds with maturin and referencing / jsonschema-specifications use hatchling.