-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi, I'm looking for ways to infer a schema from some sample Json documents.
Something like https://app.quicktype.io is able to infer a Json Schema from multiple documents, while also detecting enums and objects with similar keys. But they don't expose any underlying AST, so you're limited to the output formats they provide.
I've played around with @traversable/json
and @traversable/json-schema
with Json.fold<() => JsonSchema>
.
I've also used the resulting JsonSchema
and @traversable/valibot
with JsonSchema.fold<vx.AnyValibotSchema>
.
I'm having a few issues handling JsonSchema.Ref
correctly, but it's probably just an issue on my part 😅
Ideally I'd like to go from @traversable/json -> @traversable/schema -> @traversable/valibot
rather than using JsonSchema
as an in-between step.
Do you have any advice as to how I might do this?