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: conform bsconfig.schema.json to strict types #1205

Conversation

bartvandenende-wm
Copy link
Contributor

@bartvandenende-wm bartvandenende-wm commented May 27, 2024

Summary

bsconfig.schema.json is not (strict) type valid against jsonschema draft-07 target

fixes #1204

Details

  • remove the "deprecationMessage" attribute from "ignoreErrorCodes"
  • add "type": "array" to the "files".

Validation steps

  1. Install npm install -g ajv-cli
  2. compile schema with ajv compile -s bsconfig.schema.json --allow-union-types=true
schema bsconfig.schema.json is valid

@TwitchBronBron
Copy link
Member

This is great! Would you be willing to add a unit test that runs the validation steps? That way we can ensure it remains in compliance with the json schema in the future.

@bartvandenende-wm
Copy link
Contributor Author

This is great! Would you be willing to add a unit test that runs the validation steps? That way we can ensure it remains in compliance with the json schema in the future.

I could, but that likely would require us to move the bsconfig.schema.json into the TS src folder for the json to be importable for the unit test, which would be a breaking change.

@TwitchBronBron
Copy link
Member

TwitchBronBron commented May 31, 2024

So vscode supports the "deprecationMessage" option, and it even shows up as deprecated in the edtior. I'm not sure we should remove that property as it provides useful error messaging in the editor. I'm sure JSON schema allows for having other properties? Or perhaps ajv-cli would have an option for ignoring that error?

image

@TwitchBronBron
Copy link
Member

I added a unit test that validates the schema using ajv. The test also registers deprecationMessage as a keyword so ajv won't fail validation.

Thoughts?

@TwitchBronBron TwitchBronBron enabled auto-merge (squash) June 13, 2024 11:29
@TwitchBronBron TwitchBronBron merged commit ec4f136 into rokucommunity:master Jun 13, 2024
6 checks passed
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.

bsconfig.schema.json is not type valid against jsonschema draft-07 target
2 participants