-
Notifications
You must be signed in to change notification settings - Fork 104
Use SchemaValidator to validate tool input #203
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
Use SchemaValidator to validate tool input #203
Conversation
|
#193 totally skipped my mind. This was exactly the purpose for the Haven't gone through the code yet, but seeing this reminded me of that...so you're definitely thinking in the right direction 👍🏼 |
| break; | ||
| case 'type': | ||
| $expected = implode('|', (array) ($args['expected'] ?? [])); | ||
| $used = $args['used'] ?? 'unknown'; |
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.
Looking at the opis/json-schema package, I cannot find that $args['used'] is ever set.
cf9eab3 to
d81e7ae
Compare
|
Rebased after #153 and switched to v0.3.0 |
d81e7ae to
04781f9
Compare
chr-hertel
left a comment
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.
Thank you @Nyholm!
Opposite of #193. Let's use the unused SchemaValidator
Motivation and Context
Since we have an input schema, we can validate the input to match the schema. This makes it easier to write a tool.
How Has This Been Tested?
Unit tests and inspector
Breaking Changes
Nope
Types of changes
Checklist
Additional context