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

fix: NetKAN.schema not rejecting invalid pattern for $kref and $vref in VSCode #4258

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

Danny2462
Copy link
Contributor

Optional capture groups allowed invalid patterns like
"$kref": "#/ckan/github/foo/foo-bar/asset_WARN_match/foo-bar-baz.zip"
to not result in a warning by VSCode, now they are rejected correctly:

before:
image

after:
image

Note that it warns about the spacedock pattern, which is the first of the possible patterns - this unhelpful message is a limitation of VSCode / just this regex approach of JSON schemas in general 🤷‍♂️

Also added escape slashes where needed, which is superfluous for the C# flavor, but required in the JavaScript flavor of regex, just to be safe.

optional capture groups allowed invalid patterns like
"$kref": "#/ckan/github/foo/foo-bar/asset_WARN_match/foo-bar-baz.zip"
to work, now they are rejected correctly
@Danny2462 Danny2462 changed the title fix: NetKAN.schema not rejecting invalid pattern for $kref in VSCode fix: NetKAN.schema not rejecting invalid pattern for $kref and $vref in VSCode Nov 11, 2024
Copy link
Member

@HebaruSan HebaruSan left a comment

Choose a reason for hiding this comment

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

Thanks for this! You're right, we need $ to prevent the user from appending random extraneous text to an otherwise valid string in most cases.

NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
NetKAN.schema Outdated Show resolved Hide resolved
@HebaruSan HebaruSan added Bug Something is not working as intended Schema Issues affecting the schema labels Nov 11, 2024
Copy link
Member

@HebaruSan HebaruSan left a comment

Choose a reason for hiding this comment

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

Thanks again! 🏹

@HebaruSan HebaruSan merged commit 46ae1e0 into KSP-CKAN:master Nov 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Schema Issues affecting the schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants