python-jsonschema / python-jsonschema/referencing

Any way to get a canonical URI for an object resolved by a resolver?

Open
#257 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
27
Avg merge
1d 8h
Merged PRs (30d)
8

Description

Hi!

I'm writing a documentation tool for our configs. Basically I'm iterating over a json schema and resolve $refs via a resolver. Whenever I resolve a new $ref, I need to decide whether to inline its contents or document it as a separate entry. For this, I need to know where said ref leads, i.e. transform it to an absolute URI (possible with an anchor).

Is there a way to do so without re-implementing Resolver.lookup in my code?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Resolver.lookup and the resolver API entry points to understand how a resolved reference's destination is represented. Determine whether the existing API can expose an absolute URI, including an anchor, without duplicating lookup logic; the issue is done when callers can obtain that canonical URI through a supported interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.