Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🐛 sphinx-needs: needs.json's schema block writes "default": [] for a link type with a literal default

Open
#2,208 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

Start in generate_needs_schema in needsfile.py, and read how #2205 writes the real default for derive_by_type link types so you can follow the same pattern for plain link types with a literal default. Find the tests that pin the needs.json schema output and add a case where a link type has default = ["REQ_1"]. Done when the schema block shows the literal default as sorted, deduplicated link strings, the changelog has a "(changed output)" line, and the ubCode twin matches.

Written by the indexing model from the issue text.

Description

bug pkg: sphinx-needs

What

generate_needs_schema (needsfile.py) writes "default": [] for every link type in the needs_schema block of needs.json, also for one declared with a literal default:

[needs.links.rel]
default = ["REQ_1"]

Each need that leaves rel unset holds ["REQ_1"], but the schema block says "default": [], so an importer reading the schema assumes the wrong value for an absent rel.

#2205 already writes the real default for a link type derived by type alone (derive_by_type without derive, where the default is the value of the need types without a rule), in the export's link order. Plain link types were left as they were to keep that PR's scope.

Proposal

Write a plain link type's literal default the same way (link strings, sorted and deduplicated as an exported link list), and pin it. This changes needs.json output for projects that give a link type a default, so it needs a changelog line marked "(changed output)", and the ubCode twin should match.

Dominant language
Python
Stars
309
Forks
103
Avg merge
11h 26m
Merged PRs (30d)
118

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from useblocks/sphinx-needs

All issues in useblocks/sphinx-needs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.