feat: support minimum / maximum for numbers#140
Merged
Conversation
- includes `minimum` / `maximum` on the numeric ir model - uses these to add validations with `zod` - add `prettier` to fix bad inline-snapshot indentation (see jestjs/jest#15014) - memorize openapi validator in unit tests, speeding them up considerably (`~6s` -> `~1s` for the zod spec file)
mnahkies
added a commit
that referenced
this pull request
Apr 6, 2024
this builds on the speed up from memorizing the validator in #140, further improving the speed of the zod spec file from `~1s` -> `~200ms` (a lot better than the original `~6s`!) there's no longer any need to memorize the validator, since the require cache effectively does this for us now. the compiled validation function is pretty large, but committing it will keep me honest and prove reproducibility thanks to the CI check for uncommitted changes after running the build / tests.
mnahkies
added a commit
that referenced
this pull request
Apr 6, 2024
this builds on the speed up from memorizing the validator in #140, further improving the speed of the zod spec file from `~1s` -> `~200ms` (a lot better than the original `~6s`!) (though note, it's a bit of a wash for time in CI given it re-compiles there) there's no longer any need to memorize the validator, since the require cache effectively does this for us now. the compiled validation function is pretty large, but committing it will keep me honest and prove reproducibility thanks to the CI check for uncommitted changes after running the build / tests.
mnahkies
added a commit
that referenced
this pull request
Apr 6, 2024
#140 but for `joi` schema builders. also unifies the test harness between `zod` and `joi` schema builder tests, hopefully helping me be less lazy about improving the `joi` schema builder in lockstep with `zod`.
mnahkies
added a commit
that referenced
this pull request
Apr 6, 2024
adds support for the rest of the number validation keywords defined by JSON schema validation. also fixes a bug in #140 / #143 where `0` would be treated as `undefined` ref: https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.2
mnahkies
added a commit
that referenced
this pull request
Apr 6, 2024
adds support for the rest of the number validation keywords defined by JSON schema validation. also fixes a bug in #140 / #143 where `0` would be treated as `undefined` relates #51 ref: https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.2
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.
minimum/maximumon the numeric ir modelzodprettierto fix bad inline-snapshot indentation (see [Feature]: support biome for jest-snapshot formatting jestjs/jest#15014)~6s->~1sfor the zod spec file)IRModelobjects, and also execute the resulting schemas to parse a valuePartially addresses #51