Additional/alternative support for complex references #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The combination of this PR and PR #83 mostly fixes #76, although one use case still requires PR #82. This PR and #83 require more work on the part of the caller to configure sources, and require that the relationship between source file names or URLs and the
"$id"
URIs, such as embedded subschema"$id"
URIs, be known in advance.This PR adds a
RewritingSourceMixin
class, which allows constructing sources that rewrite the URIs requested so that the URI structure and storage layout can have a more complex relationship.This particularly facilitates references to schema resources embedded in bundles, or references to URI components that use characters not allowed in filesystems, or a unified URI namespace that is distributed across multiple repositories in a test environment.
The
RewritingLocalSource
andRewritingRemoteSource
simply add the new functionality to the two existing sources. The relevance of PR #83 is that it enables arbitrary rewriting, instead of restricting the rewriting only to valid relative URI-references.