-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
For a while I have been wanting to do #107, but now I think it is better to consider https://json-schema.org/ instead because:
- IPLD schema does not allow inlining and it introduces need for naming things or deriving by hash which would be fairly unreadable.
- JSON schema has far more adoption than IPLD schema
- In my experience while IPLD schema has some good ideas lack of generics severely limits it's expressiveness and makes schemas really hard to read
On the other hand JSON schema lacks certain things that would have been extremely valuable in the context of ucanto
- Lack of representation strategies
- This IPLD Schema feature is controversial is it maps model at runtime to a model on wire. But what if nodes across the wire want to use different runtime representation ? Or what if they want to negotiate the wire representation ? On the other hand if you treat it as mapping between logical model and structured model it does seem useful (e.g. logical set mapped to an array of unique elements). Tension comes when different field names are desired or when names are dropped entirely in favor of positional products like tuples)
- Representing multiformat via schema seems very useful
- Capturing semantics like (sets) are also very useful
- Lack of generic link type
Overall it seems like it would be fairly straightforward to implement support for JSON schema, which would not exclude adding support for IPLD schema in the future.
Metadata
Metadata
Assignees
Labels
No labels