Skip to content

Improve schema include behavior #239

Description

@Bergmann89

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions