Add validator and additionalProperties bool to Unity#80
Open
thorminate wants to merge 7 commits intoVedalAI:mainfrom
Open
Add validator and additionalProperties bool to Unity#80thorminate wants to merge 7 commits intoVedalAI:mainfrom
thorminate wants to merge 7 commits intoVedalAI:mainfrom
Conversation
9a64447 to
c7665d0
Compare
Author
|
i forgor to remove a debug logger lol |
Alexejhero
reviewed
Jan 30, 2026
Co-authored-by: alexvoid <[email protected]>
Co-authored-by: alexvoid <[email protected]>
349a3a1 to
90e02d7
Compare
Author
|
This should work fine now 🤞 |
Author
|
@Alexejhero is it better to keep the additionalProperties bool ignored by json? as the spec does specifically say that that schema prop doesn't really do much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a built-in validator to QJS for ActionJData, JToken, and plain objects.
Full support for schema constraints like type, const, enum, required properties, min/max, pattern, arrays and the new
additionalPropertiesbool.additionalPropertiesjust dictates if any other properties beyond the schema are allowed. It could be used to prevent typos or unintended fields by NeuroFully backward-compatible.
It has been briefly tested on my own personal project and seems to working fine, please let me know if any changes are needed.
Note: this does not replace existing action validation logic, it just ensures all the properties you expect exist and is of the desired type.
A decently large validator for a pretty large schema could look like this
but with the validator, all that could be compressed to this: (given that the schema is fed adequate data, like regex patterns or enums)
All and all, with these changes along with my other pull requests, this should help encourage making proper schemas and decrease bugs in validation code.