tent / tent.io

The website for Tent — the protocol for evented data storage and decentralized communication
https://tent.io
Other
794 stars 97 forks source link

Machine-readable post type schemas #107

Open graue opened 11 years ago

graue commented 11 years ago

Each post type is already a URL like https://tent.io/types/post/status/v0.1.0. It could be useful if each such URL linked to a schema with which servers can automatically verify a post of that type is well-formed.

I already suggested this on Tent and ^longears.tent.is added: "Don't make it mandatory though. If someone invents a post type which becomes popular, and then later they let the schema go offline, the post type should keep working. Also: servers or apps could validate against the schema when posting -- better if apps do it and not servers. Definitely don't try to validate when viewing or you'll end up blocking posts which are extended or slightly nonstandard." All of which seems very sensible to me.

Opening an issue here so we can keep track easily of thoughts on this.

longears commented 11 years ago

I guess the most useful questions are: under what conditions should a post be verified against the schema, which actor(s) should do it, and what should happen when it fails?

Maybe the type URL could have a human-readable spec for that post type. There will be some rules for a post type that can't be captured in a machine-readable schema. See the proposed new Photo type for an example of that: https://github.com/tent/tent.io/issues/78#issuecomment-9136957

mwanji commented 11 years ago

I think a human-readable spec should be the default. I can't imagine any mobile apps wanting to parse against a schema (JSON-schema?) on a low-cost Android over a slow/expensive 3G or even Edge. Let's be a little liberal in what we accept.

It would be interesting to have an validator for post types, though, similar to an HTML validator. Post producers could use it to check their output and therefore be conservative in what they send.

longears commented 11 years ago

Another great thing to have at the type URL would be a mailing list or RSS feed which would announce new versions of that type. There are going to be a lot of types and app authors will need some help keeping up to date with all of them.

redaktor commented 11 years ago

@mwanji "Validator" WIP : https://github.com/tent/tent-validator