-
-
Notifications
You must be signed in to change notification settings - Fork 208
perf: avoid addComma when not necessary #802
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
base: main
Are you sure you want to change the base?
Conversation
Just a small performance improvements when an array has only one item Signed-off-by: francesco <[email protected]>
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.
The approach is good, but additionalProperties can break your neck
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00#rfc.section.10.3.2.3
And what does empty schema do? https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00#rfc.section.4.3.2
In result, this means, that if additionalProperties is not set So, to be compliant with json schema, you have to check that it is explicitly not false. |
Signed-off-by: francesco <[email protected]>
Signed-off-by: francesco <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: francesco <[email protected]>
done a1fade3 |
Can you add some tests please? |
Signed-off-by: francesco <[email protected]>
done c8a0a47 Side note: the current tests also cover this changes |
Why did the CI not fail on first commit? |
also my new test c8a0a47 don't fail with first commit 😂 I didn't understand what I have to stay in this PR. It seems to me that the existing tests already cover all PR cases |
Just a small performance improvements when an object contains only one key or an array only one item
Side note: the benchmark don't cover this case