python-jsonschema / python-jsonschema/referencing

Consider providing `retrieve` functions with an enclosing specification

Open
#65 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

Sometimes one wants to retrieve a resource but default to the specification of the document it is contained within.

In other words, to call Resource.from_contents(..., default_specification=enclosing_specification) from within a retrieval function.

This isn't completely trivial to implement however, because users can call .get_or_retrieve(uri) directly, meaning the argument would have to exist there too. Additionally, resources can be root resources of course, so enclosing_specification would anyways potentially be None for such cases.

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 reading the retrieval functions and the Resource.from_contents and get_or_retrieve(uri) entry points named in the issue. Trace how an enclosing specification could be passed through direct and nested retrieval, including root resources where it is None. Done means retrieval can default to the containing document's specification without breaking direct calls or root resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.