-
Notifications
You must be signed in to change notification settings - Fork 250
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
feat(validation): add validation on plugin options #2158
Conversation
@@ -27,6 +32,10 @@ export class PluginLoader implements PluginResolver { | |||
}); | |||
} | |||
|
|||
public resolveValidationSchemaContributions(): object[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use a getter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we could. Wanted to keep it in line with the other method. Also want to keep it open for us to do a dynamic search in the future.
|
||
import { coreTokens } from '../di'; | ||
|
||
function mergedSchema(mainSchema: any, additionalSchemas: any[]): object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aren't these object
s? (a bit more strict than any)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I didn't want to bother with trying to explain TypeScript that it has properties
and definitions
. I know they have them and it is a private API for the time being. Didn't want to waste time on writing code to validate that the schemas are valid json schemas.
A Stryker plugin is now able to contribute to the validation of StrykerOptions. Export a JSON schema from your plugin with the name
strykerValidationSchema
and it will be added to the validation.Also some housekeeping: 🏡
[k: string]: unknown
instead of[k: string: any
. This added about 100 compiler errors that I had to fix.Example:
TODO