schemas: generate some good schemas
This commit is contained in:
parent
ed56ed5368
commit
b7a2201ad6
10 changed files with 205 additions and 122 deletions
167
schemas/bc2.json
167
schemas/bc2.json
|
@ -1,87 +1,86 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "https://bypass.censorship.guide/schema/bc2.json",
|
||||
"type": "object",
|
||||
"title": "Bypass Censorship Version 2",
|
||||
"required": [
|
||||
"sites",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"sites": {
|
||||
"$id": "#/properties/sites",
|
||||
"type": "array",
|
||||
"title": "The sites schema",
|
||||
"additionalItems": true,
|
||||
"items": {
|
||||
"$id": "#/properties/sites/items",
|
||||
"type": "object",
|
||||
"title": "The items schema",
|
||||
"required": [
|
||||
"available_alternatives",
|
||||
"main_domain"
|
||||
],
|
||||
"properties": {
|
||||
"available_alternatives": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives",
|
||||
"type": "array",
|
||||
"title": "The available_alternatives schema",
|
||||
"additionalItems": true,
|
||||
"items": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives/items",
|
||||
"type": "object",
|
||||
"title": "The items schema",
|
||||
"required": [
|
||||
"created_at",
|
||||
"proto",
|
||||
"type",
|
||||
"updated_at",
|
||||
"url"
|
||||
],
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives/items/properties/created_at",
|
||||
"type": "string",
|
||||
"title": "The created_at schema"
|
||||
},
|
||||
"proto": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives/items/properties/proto",
|
||||
"type": "string",
|
||||
"title": "The proto schema"
|
||||
},
|
||||
"type": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives/items/properties/type",
|
||||
"type": "string",
|
||||
"title": "The type schema"
|
||||
},
|
||||
"updated_at": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives/items/properties/updated_at",
|
||||
"type": "string",
|
||||
"title": "The updated_at schema"
|
||||
},
|
||||
"url": {
|
||||
"$id": "#/properties/sites/items/properties/available_alternatives/items/properties/url",
|
||||
"type": "string",
|
||||
"title": "The url schema"
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"main_domain": {
|
||||
"$id": "#/properties/sites/items/properties/main_domain",
|
||||
"type": "string",
|
||||
"title": "The main_domain schema"
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"version": {
|
||||
"$id": "#/properties/version",
|
||||
"type": "string",
|
||||
"title": "The version schema"
|
||||
}
|
||||
"title": "Bypass Censorship Version 2",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"title": "Version",
|
||||
"description": "Version number of the Bypass Censorship Extension schema in use",
|
||||
"type": "string"
|
||||
},
|
||||
"additionalProperties": true
|
||||
"sites": {
|
||||
"title": "Sites",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/BC2Site"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"sites"
|
||||
],
|
||||
"definitions": {
|
||||
"BC2Alternative": {
|
||||
"title": "BC2Alternative",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"proto": {
|
||||
"title": "Proto",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"title": "Created At",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"title": "Updated At",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"url": {
|
||||
"title": "Url",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"proto",
|
||||
"type",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"url"
|
||||
]
|
||||
},
|
||||
"BC2Site": {
|
||||
"title": "BC2Site",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"main_domain": {
|
||||
"title": "Main Domain",
|
||||
"description": "The main domain name of the website, excluding \"www.\" if present.",
|
||||
"examples": [
|
||||
"bbc.co.uk",
|
||||
"bbc.com",
|
||||
"guardianproject.info"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"available_alternatives": {
|
||||
"title": "Available Alternatives",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/BC2Alternative"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"main_domain",
|
||||
"available_alternatives"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue