Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary backslash from regex patterns #289

Closed
mvandenburgh opened this issue Feb 24, 2025 · 2 comments · Fixed by #290
Closed

Remove unnecessary backslash from regex patterns #289

mvandenburgh opened this issue Feb 24, 2025 · 2 comments · Fixed by #290

Comments

@mvandenburgh
Copy link
Member

Related: dandi/dandi-archive#2179

VJSF 3 does not work with the current schema due to these regex patterns being flagged by ajv as invalid -
https://github.com/dandi/dandi-schema/blob/master/dandischema/models.py#L1615
https://github.com/dandi/dandi-schema/blob/master/dandischema/models.py#L969

In particular, the \ character before the colons is triggering it. I confirmed that removing it fixes the issue, and VJSF renders the schema correctly. VJSF 3 offloads a significant amount of the validation/schema parsing to ajv compared to VJSF 2, so I believe that is why this is just coming up now.

@yarikoptic @candleindark @satra what is the purpose of the backslash here? From my understanding, the : character shouldn't need to be escaped in a regex. And if there's no particular reason for it to exist, can we remove it?

@satra
Copy link
Member

satra commented Feb 24, 2025

And if there's no particular reason for it to exist, can we remove it?

sure.

@yarikoptic
Copy link
Member

I also do not see a point of having them... there is no specific commit which added them , so most likely some "historical artifact". submitting PR

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 a pull request may close this issue.

3 participants