SchemaStore / SchemaStore/schemastore

Path matching too loose

Open
#1,206 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

fileMatch Conflict
Dominant language
JavaScript
Stars
3.8k
Forks
2.3k
Avg merge
20h 23m
Merged PRs (30d)
124

Description

In cases like this one:
https://github.com/SchemaStore/schemastore/blob/f3183484dbc0ed4504651fd6efc1a6035842823b/src/api/json/catalog.json#L434-L439

The path pattern will match package.json but will also match something-else-package.json.
This is an issue for many other definitions also.
Is that on purpose?

I think it could be fixed by prefixing such paths (that should match fully) with a forward slash, so /package.json but I'm not sure if that would work on Windows also.

Contributor guide

Open the contributing guide

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 with the referenced entries in src/api/json/catalog.json at lines 434-439 and inspect how their path patterns are interpreted. Confirm whether package.json also matches something-else-package.json, including on Windows, and consider the proposed leading-slash behavior. Done means exact package paths match without the unintended prefixed-name matches.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.