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

Report a malformed required-extension name at its own array position, and cover it

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

Maintainers usually reply within 1 day

@Haxxyyyy is already working on this.

Since Oct 14, 2026.

  • #143 by @Haxxyyyy — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
json, python
Domain
testing, tooling

Research direction

Start in schema_diagnostic in tests/test_repository.py around line 320, where the propertyNames branch appends the offending string to the instance path. Print error.absolute_schema_path for an extensions key and for a metadata.requiredExtensions item, then append only for propertyNames. Add the two structural fixtures under conformance/structural/ and their cases, then run the unittest discover command. Done means both new cases report /metadata/requiredExtensions/0 with one diagnostic each. Pull request #143 is already open against this issue, so check it first.

Written by the indexing model from the issue text.

Description

good first issue

Goal

Make the repository's validator point a malformed metadata.requiredExtensions name at the array element (/metadata/requiredExtensions/0), and add two structural cases for it: an unqualified name and a reserved org.judgmentpack. name.

Why

Core §9 gives extension names reverse-domain form, and reserves the org.judgmentpack. prefix. The schema holds metadata.requiredExtensions items to the same pattern as the keys of extensions (schema/judgment-pack-core.schema.json:417). The corpus covers the pattern only for extensions keys (structural-unqualified-extension, structural-reserved-extension-name). Removing the pattern from the items of requiredExtensions on current main (a024118), with the full suite of 100 tests, passes. No fixture has an unqualified or reserved name in requiredExtensions.

The validator also gives such a name a pointer that names nothing. This branch (tests/test_repository.py:320):

elif "org\\.judgmentpack" in pattern:
    code = "JPS-STRUCTURE-EXTENSION-NAME"
    if isinstance(error.instance, str):
        instance_path.append(error.instance)

appends the offending string to the error's path. That is right for an extensions key, which the schema checks through propertyNames, so the path ends at the object and the key must be added. It is wrong for an array item, whose path already ends at the item. Measured on a024118 with "requiredExtensions": ["review-policy"], the validator reports JPS-STRUCTURE-EXTENSION-NAME at /metadata/requiredExtensions/0/review-policy, which resolves to nothing. jpack spec validate --format json (jpack 0.24.0) reports /metadata/requiredExtensions/0 for the same document, one diagnostic.

Both cases were prototyped from valid/minimal-expense-approval.json with "metadata": {"requiredExtensions": ["review-policy"]} and ["org.judgmentpack.review-policy"]. On the unmodified validator both fail on the pointer. With the branch changed to append only when "propertyNames" in schema_path, both pass with one diagnostic each, the existing two extensions cases still pass, and removing the pattern from the items fails exactly the two new cases.

Scope

  • In schema_diagnostic, append the offending string only for a propertyNames error. To see what tells the two apart, print error.absolute_schema_path for an extensions key and for a requiredExtensions item.
  • Add two fixtures under conformance/structural/ and two entries beside the existing extension-name cases, with layer: "structural", expectedResult: "invalid", JPS-STRUCTURE-EXTENSION-NAME at /metadata/requiredExtensions/0, and specSection: "§9".
  • Update the corpus count statements; a harness test names each stale one.
  • Do not change the schema, the spec, any other code mapping, or any existing fixture or case.

Acceptance criteria

  • The two new cases pass, and structural-unqualified-extension and structural-reserved-extension-name still pass unchanged.
  • Each new fixture carries only its one defect.
  • Try the mutation and say so: (1) restore the old branch and watch both new cases fail on the pointer; (2) remove the pattern from the requiredExtensions items and watch both grade valid. Say in the pull request that you did both.
  • The corpus count statements match the manifest again.
  • python -m pip install -r requirements-dev.txt then python -m unittest discover -s tests -v passes.
  • Every commit includes a DCO sign-off created with git commit -s.

Contributor learning

A JSON Schema error's path says where the failing value sits. For propertyNames the failing value is a key, which has no place of its own in the instance path. For an array item it does. You will see why "record what the suite reports" is only as good as the pointer the validator builds.

Dominant language
Python
Stars
5
Forks
6
Avg merge
6h 15m
Merged PRs (30d)
69

Getting set up

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 Judgment-Pack/judgment-pack-spec

All issues in Judgment-Pack/judgment-pack-spec

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.