When a schema location is already in cache, resolve_location returns early without performing the include-specific targetNamespace validation/inheritance logic below. This can silently accept a cached schema under a different current_ns (or skip inheriting targetNamespace for an included schema that has none), depending on which request type resolved it first. Consider keying the cache by (location, current_ns/request_type) or, at minimum, validating/setting schema.target_namespace against req.current_ns even on cache hits (and erroring on mismatch for IncludeRequest).
Also verify if this is really an issue or a needed improvement. Potentially included schemas without an explicit namespace set could be imported from schemas in different namespaces, leading to missing/conflicting type definitions.
Originally posted by @Copilot in #238 (comment)
When a schema
locationis already incache,resolve_locationreturns early without performing the include-specific targetNamespace validation/inheritance logic below. This can silently accept a cached schema under a differentcurrent_ns(or skip inheritingtargetNamespacefor an included schema that has none), depending on which request type resolved it first. Consider keying the cache by(location, current_ns/request_type)or, at minimum, validating/settingschema.target_namespaceagainstreq.current_nseven on cache hits (and erroring on mismatch forIncludeRequest).Also verify if this is really an issue or a needed improvement. Potentially included schemas without an explicit namespace set could be imported from schemas in different namespaces, leading to missing/conflicting type definitions.
Originally posted by @Copilot in #238 (comment)