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.
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
feat: support JSON Schema as input for a Type #1159
base: main
Are you sure you want to change the base?
feat: support JSON Schema as input for a Type #1159
Changes from 45 commits
2c2bdf1
a3fd9cd
01583b0
9e3e772
85e5558
886e643
00baf27
2a94bcd
98533ad
ae9342e
a2ed10f
170bc6e
9d0bf28
8628a77
77562e3
b7c38a0
0e5b2da
cf77faa
4c4e61f
934cd36
d3bc90d
da95a37
4d230c1
48a654a
b343bfe
98e9c03
6dbdbcd
7248b27
79c0a79
28da503
4127422
474a849
95e1b40
2e21553
2d945b3
94cdef2
6903094
d65fa30
8e97d87
877f36e
d59336c
e150832
f625bc9
dd130e8
4598d02
f7bd853
03ba515
01e296c
dc43e17
be4fff2
b6e5c70
423ba89
2fe1b7a
d0e612b
07a5215
2da7bb5
a1f2911
0e1dac7
fc67ff7
aa81782
de4c7cc
ce9b213
ad9e053
8dc5826
c55e9aa
624c0ac
9826c00
5272e44
aaf7d46
6221890
20f446b
0fac361
65112a1
1567862
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@ssalbdivad are you open to lifting ArkType's restriction on divisors being non-integers? Or, if not/as an interim solution, it seems this could be added as a custom
narrow
constraint?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 can add whatever arbitrary validation you want in a narrow, but the reason we don't support this is because there isn't a straightforward way to test float divisibility without complex + potentially fallible string math.
@TizzySaurus was actually working on an implementation but it doesn't make sense to add a dependency or implement that much custom logic for such a niche case.
For rational values like
0.1
, you could testing something like(n: number) => (n * 10) % 1 === 0
. Outside that though, things tend to get scary so be careful.