lib/schema.json

112 lines · 4576 bytes

  1{
  2  "$schema": "http://json-schema.org/draft-07/schema#",
  3  "type": "object",
  4  "properties": {
  5    "categories": {
  6      "type": "array",
  7      "items": {
  8        "type": "object",
  9        "properties": {
 10          "name": { "type": "string", "minLength": 1, "maxLength": 50 },
 11          "sections": {
 12            "type": "array",
 13            "items": {
 14              "type": "object",
 15              "properties": {
 16                "name": { "type": "string", "minLength": 1, "maxLength": 100 },
 17                "services": {
 18                  "type": "array",
 19                  "items": {
 20                    "type": "object",
 21                    "properties": {
 22                      "name": { "type": "string", "minLength": 1, "maxLength": 100 },
 23                      "description": { "type": "string", "minLength": 10, "maxLength": 1500 },
 24                      "url": {
 25                        "type": "string",
 26                        "anyOf": [
 27                          { "pattern": "^https?://" },
 28                          { "maxLength": 0 }
 29                        ]
 30                      },
 31                      "github": {
 32                        "type": ["string", "null"],
 33                        "pattern": "^([a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+|https://github\\.com/.+)$"
 34                      },
 35                      "icon": {
 36                        "type": ["string", "null"],
 37                        "pattern": "^https?://.+"
 38                      },
 39                      "followWith": { "type": ["string", "null"], "minLength": 1, "maxLength": 100 },
 40                      "securityAudited": { "type": ["boolean", "null"] },
 41                      "openSource": { "type": ["boolean", "null"] },
 42                      "acceptsCrypto": { "type": ["boolean", "null"] },
 43                      "tosdrId": { "type": ["integer", "null"], "minimum": 1 },
 44                      "iosApp": {
 45                        "type": ["string", "null"],
 46                        "pattern": "^https://apps\\.apple\\.com/"
 47                      },
 48                      "androidApp": {
 49                        "type": ["string", "null"],
 50                        "pattern": "^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)+$"
 51                      },
 52                      "discordInvite": {
 53                        "type": ["string", "null"],
 54                        "pattern": "^(https://discord\\.gg/[a-zA-Z0-9]+|[a-zA-Z0-9]+|)$"
 55                      },
 56                      "subreddit": {
 57                        "type": ["string", "null"],
 58                        "pattern": "^[a-zA-Z0-9_]+$",
 59                        "minLength": 1,
 60                        "maxLength": 50
 61                      }
 62                    },
 63                    "required": ["name", "description", "url"],
 64                    "additionalProperties": false
 65                  }
 66                },
 67                "intro": { "type": ["string", "null"], "minLength": 1 },
 68                "notableMentions": {
 69                  "oneOf": [
 70                    {
 71                      "type": "array",
 72                      "items": {
 73                        "type": "object",
 74                        "properties": {
 75                          "name": { "type": "string", "minLength": 1, "maxLength": 100 },
 76                          "description": { "type": "string", "minLength": 1 },
 77                          "url": { "type": "string", "pattern": "^https?://" }
 78                        },
 79                        "required": ["name", "url"],
 80                        "additionalProperties": false
 81                      }
 82                    },
 83                    { "type": "string", "minLength": 1 },
 84                    { "type": "null" }
 85                  ]
 86                },
 87                "furtherInfo": { "type": ["string", "null"], "minLength": 1 },
 88                "wordOfWarning": { "type": ["string", "null"], "minLength": 1 },
 89                "alternativeTo": {
 90                  "oneOf": [
 91                    {
 92                      "type": "array",
 93                      "items": { "type": "string", "minLength": 1, "maxLength": 100 },
 94                      "minItems": 1
 95                    },
 96                    { "type": "null" }
 97                  ]
 98                }
 99              },
100              "required": ["name", "services"],
101              "additionalProperties": false
102            }
103          }
104        },
105        "required": ["name", "sections"],
106        "additionalProperties": false
107      }
108    }
109  },
110  "required": ["categories"],
111  "additionalProperties": false
112}