Enhanced Feed Info Schema

Jah Power Bit has put up an Enhanced Feed Info Schema for Counterparty Binary Bets.

It can be found here: https://www.jahpowerbit.org/feeds/feed.schema.json
based on: http://json-schema.org/

[quote][pre]
{ "$schema": "http://json-schema.org/schema#", "definitions": { "type" : { "enum": ["binary", "cfd", "all"] }, "categories" : { "enum": ["sports", "politics", "entertainment", "economics", "other"] }, "owner": { "type": "object", "properties": { "name": {"type" : "string", "maxLength": 64}, "image": {"type" : "string", "format": "uri"}, "description": {"type" : "string", "maxLength": 255}, "url": {"type" : "string", "format": "uri"} }, "required": ["name"] }, "event": { "type": "object", "properties": { "name": {"type" : "string", "maxLength": 64}, "image": {"type" : "string", "format": "uri"}, "description": {"type" : "string", "maxLength": 255}, "url": {"type" : "string", "format": "uri"}, "date": {"type" : "string", "format": "date-time"} }, "required": ["name", "date"] }, "outcome": { "type": "object", "properties": { "text": {"type" : "string", "maxLength": 64}, "target_value": {"type" : "number"}, "image": {"type" : "string", "format": "uri"}, "labels": { "type": "object", "properties": { "equal": {"type" : "string", "maxLength": 32}, "not_equal": {"type" : "string", "maxLength": 32} }, "required": ["equal", "not_equal"] } }, "required": ["text", "target_value"] }, "outcomes": { "type": "array", "items": {"$ref": "#/definitions/outcome"}, "minItems": 1, "uniqueItems": true }, "deadlines": { "type": "array", "items": {"type": "string", "format": "date-time"}, "minItems": 1, "uniqueItems": true } }, "type" : "object", "properties" : { "address" : {"type" : "string"}, "type" : {"$ref": "#/definitions/type"}, "category": {"$ref": "#/definitions/categories"}, "owner": {"$ref": "#/definitions/owner"}, "event": {"$ref": "#/definitions/event"}, "outcomes": {"$ref": "#/definitions/outcomes"}, "deadlines": {"$ref": "#/definitions/deadlines"} }, "required": ["address", "type", "category", "owner", "event", "outcomes", "deadlines"] }[/pre][/quote]

I have several questions:

1. Is there a change log for the schema?
It’d be useful to have a changelog or a Github location so that we can track what’s changing and when.

2. What happens with “outdated” enhanced feed infos?
For example, what happens if one writes a JSON file which at some point (but before the event deadline) becomes outdated or even invalid?

3. Should there be some schema versioning tag included in this (this is related to Q2 above)?
If not, how do we know which (already issued) feed infos need to be changed to reflect the latest schema and not be declared invalid/corrupt?

4. For the feed info itself, would it make sense to have something like optional version number in it so that the owner can voluntarily provide information about changes he’s been making to the enhanced feed file?
Ideally feed info (especially outcome mappings) shouldn’t change, but in reality it probably will (e.g. new URI of the event, etc.). On the other hand incremented version info could allow us to track updates and notify watchers about them.

[quote author=something link=topic=346.msg2392#msg2392 date=1400545706]
1. Is there a change log for the schema?
It’d be useful to have a changelog or a Github location so that we can track what’s changing and when.
[/quote]

You right. This is only a preview version. As soon as the first version is finalised, I’ll create a github repository only for schemas (feeds and tokens).

[quote author=something link=topic=346.msg2392#msg2392 date=1400545706]
2. What happens with “outdated” enhanced feed infos?
For example, what happens if one writes a JSON file which at some point (but before the event deadline) becomes outdated or even invalid?
[/quote]

As soon as the github repo will be up with clean releases/tags, applications can manage this.
Also the schema is not supposed to changed a lot, and I think we can keep backward compatibility easily.

[quote author=something link=topic=346.msg2392#msg2392 date=1400545706]
3. Should there be some schema versioning tag included in this (this is related to Q2 above)?
If not, how do we know which (already issued) feed infos need to be changed to reflect the latest schema and not be declared invalid/corrupt?
[/quote]

yes

[quote author=something link=topic=346.msg2392#msg2392 date=1400545706]
4. For the feed info itself, would it make sense to have something like optional version number in it so that the owner can voluntarily provide information about changes he’s been making to the enhanced feed file?
Ideally feed info (especially outcome mappings) shouldn’t change, but in reality it probably will (e.g. new URI of the event, etc.). On the other hand incremented version info could allow us to track updates and notify watchers about them.
[/quote]

I think it’s a good idea to add a “version” attribute, but to indicate the schema version used.
Also I will add an optional attribute “customs”, that can contains arbitrary key/values, so the owner can provide additional informations.


Excellent, thanks.

[quote author=JahPowerBit link=topic=346.msg2394#msg2394 date=1400601134]

Also I will add an optional attribute "customs", that can contains arbitrary key/values, so the owner can provide additional informations.
[/quote]


Cool. I wanted to ask for that!  ;D