Simon
Explore posts from serversAarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Oh I missed that, makes sense
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
I'm having some weird results with the select but maybe I'm misunderstanding how it works.
Given the following schema:
Prints:
Which is expected.
This however returns an empty array.
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Looks like my isOptional is not stable for all schemas.
Is something like this supposed to be the way?
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
@ArkDavid is the
.select
function costly?
I wonder if I can run a few of those for each field and automatically add the components (like "— optional" or "0 / 4000 characters") if the constraints exists or if there will be a heavy price for large forms53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Makes sens yeah
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Just tested and that's awesome.
I could quickly create a few helpers that are easily typed & reused
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Very interesting. That’d make it really more easy to deal with!
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Thanks for guiding me through this 🙂 I think I have what I need to go further now
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Ah yeah, also need to check if not null
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
bummer that I can't seem to narrow to the JsonObject instead of dismissing string, boolean, number etc..
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Got to something with some checks.
I suppose I can make helpers and use those as I won't have that many different cases
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
depending on the number of rules I suppose or the kind of rules
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Looks like it returns either an object or an array of objects
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Ah yes, that looks promising
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Indeed, is there a way to get the "maxLength" from that?
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
Not sure how I could use the type itself 🤔
I don't want to validate, I want to get the validation rules if that matters
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
here's my schema:
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
It feels kind of counterproductive. My goal is to reuse the schema to get the values like required/maxLength.
If I check property access it feels like a rabbit hole.
My first tests were unconclusive.
Here's a sample:
In this instance,
type
does not exist in schema.properties[field.name]
Property 'type' does not exist on type 'NonBooleanBranch'. Property 'type' does not exist on type 'Const'.ts(2339)
53 replies
Aarktype
•Created by Simon on 4/23/2025 in #questions
Can the JSON Schema be typed automatically?
That's a bummer. Is there any know libs that do the heavy lifting for us?
53 replies