Skip to content

Improve schema include behavior #239

@Bergmann89

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions