Skip to content

Add regex validation pattern in schema version property#450

Open
alejoe91 wants to merge 3 commits into
SpikeInterface:mainfrom
alejoe91:add-regex-version-schema
Open

Add regex validation pattern in schema version property#450
alejoe91 wants to merge 3 commits into
SpikeInterface:mainfrom
alejoe91:add-regex-version-schema

Conversation

@alejoe91

Copy link
Copy Markdown
Member

Fixes #448

@alejoe91 alejoe91 requested a review from h-mayorquin July 2, 2026 07:33

@h-mayorquin h-mayorquin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Two small things on the schema header:

$id resolves to 404. The $id added here points at https://probeinterface.readthedocs.io/schema/probe.json.schema, but nothing is served there: readthedocs publishes rendered docs under /en/<version>/, not the raw .schema file. It does not affect validation ($id is just an identifier), but it is misleading to anyone who tries to fetch the schema from it. Simplest fix is to point it at the raw file, which already resolves and needs no docs-build changes:

"$id": "https://raw.githubusercontent.com/SpikeInterface/probeinterface/main/src/probeinterface/schema/probe.json.schema"

(Alternatively, drop $id entirely, or serve the schema under the docs domain if you want that URL to work.)

Pre-existing bug, noticed while here: the specification constraint is a no-op. The field uses "value": "probeinterface", but value is not a JSON Schema keyword, so it is ignored and any string passes ("", "openephys", etc. all validate). The keyword you want is const: {"type": "string", "const": "probeinterface"}. Not introduced by this PR, but since it is tightening the header it may be worth fixing in the same pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decorate schema with specification version information

2 participants