-
Notifications
You must be signed in to change notification settings - Fork 5
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
Rework evaluation attribute schema validation #441
Conversation
commit: |
src/schema/evaluatorSchemas.ts
Outdated
new StringType({maxLength: 255}), | ||
]; | ||
|
||
const getNestedSchemas = (): [...PrimitiveSchemas, ...TypeSchema[]] => [ |
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.
You don't need this nested function. Is there any reason not to replicate the evaluation service's function?
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.
This is a replica, just a little more verbose because in PHP we can type the array and the associative array at once, here we need to type the array and the object separately
There is one difference, though, that I left out on purpose: the evaluation service's validation allows attributes as arrays like {attributes: [1, 2, 3]}
, but here we'll only allow actual objects
Summary
This PR will make the schema validation more robust, very similar to what is done in this part of the evaluation-service
It also increases the maximum amount of characters
Checklist