Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JSON Schema for Microformats
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"type": { "$ref": "#/definitions/types" },
"properties": { "$ref": "#/definitions/properties" },
"children": {
"type": "array",
"items": { "$ref": "#" }
},
"id": { "type": "string" }
},
"required": ["type", "properties"],
"additionalProperties": false,
"definitions" : {
"types": {
"type": "array",
"items": {
"type": "string",
"pattern": "^h-([0-9a-z]+-)?[a-z]+(-[a-z]+)*$"
},
"minItems": 1
},
"properties": {
"type": "object",
"patternProperties": {
"^([0-9a-z]+-)?[a-z]+(-[a-z]+)*$": {
"type": "array",
"items": {
"oneOf": [
{ "type": "string" },
{ "$ref": "#/definitions/htmlproperty" },
{ "$ref": "#/definitions/complexproperty" },
{ "$ref": "#/definitions/imageproperty" }
]
}
}
},
"additionalProperties": false
},
"htmlproperty": {
"type": "object",
"properties": {
"html": { "type": "string" },
"value": { "type": "string" }
},
"required": ["html", "value"],
"additionalProperties": false
},
"complexproperty": {
"type": "object",
"properties": {
"type": { "$ref": "#/definitions/types" },
"properties": { "$ref": "#/definitions/properties" },
"value": { "type": "string" },
"html": { "type": "string" }
},
"required": ["type", "properties", "value"],
"additionalProperties": false
},
"imageproperty": {
"type": "object",
"properties": {
"value": { "type": "string" },
"alt": { "type": "string" }
},
"required": ["value", "alt"],
"additionalProperties": false
}
}
}
@rosskarchner

This comment has been minimized.

Copy link

commented Aug 2, 2019

Is there any chance you could specify a license for this?

@Zegnat

This comment has been minimized.

Copy link
Owner Author

commented Aug 2, 2019

@rosskarchner, I honestly do not think this factual JSON file is copyrightable. But you may consider it public domain under CC0 1.0 Universal just like any contribution I have made to microformats.org (see microformats copyrights) and to the PHP parser (see LICENSE).

@rosskarchner

This comment has been minimized.

Copy link

commented Aug 2, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.