lib/schema.json

120 lines · 4946 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                      "codeberg": {
 36                        "type": ["string", "null"],
 37                        "pattern": "^([a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+|https://codeberg\\.org/.+)$"
 38                      },
 39                      "git": {
 40                        "type": ["string", "null"],
 41                        "pattern": "^https?://.+"
 42                      },
 43                      "icon": {
 44                        "type": ["string", "null"],
 45                        "pattern": "^https?://.+"
 46                      },
 47                      "followWith": { "type": ["string", "null"], "minLength": 1, "maxLength": 100 },
 48                      "securityAudited": { "type": ["boolean", "null"] },
 49                      "openSource": { "type": ["boolean", "null"] },
 50                      "acceptsCrypto": { "type": ["boolean", "null"] },
 51                      "tosdrId": { "type": ["integer", "null"], "minimum": 1 },
 52                      "iosApp": {
 53                        "type": ["string", "null"],
 54                        "pattern": "^https://apps\\.apple\\.com/"
 55                      },
 56                      "androidApp": {
 57                        "type": ["string", "null"],
 58                        "pattern": "^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)+$"
 59                      },
 60                      "discordInvite": {
 61                        "type": ["string", "null"],
 62                        "pattern": "^(https://discord\\.gg/[a-zA-Z0-9]+|[a-zA-Z0-9]+|)$"
 63                      },
 64                      "subreddit": {
 65                        "type": ["string", "null"],
 66                        "pattern": "^[a-zA-Z0-9_]+$",
 67                        "minLength": 1,
 68                        "maxLength": 50
 69                      }
 70                    },
 71                    "required": ["name", "description", "url"],
 72                    "additionalProperties": false
 73                  }
 74                },
 75                "intro": { "type": ["string", "null"], "minLength": 1 },
 76                "notableMentions": {
 77                  "oneOf": [
 78                    {
 79                      "type": "array",
 80                      "items": {
 81                        "type": "object",
 82                        "properties": {
 83                          "name": { "type": "string", "minLength": 1, "maxLength": 100 },
 84                          "description": { "type": "string", "minLength": 1 },
 85                          "url": { "type": "string", "pattern": "^https?://" }
 86                        },
 87                        "required": ["name", "url"],
 88                        "additionalProperties": false
 89                      }
 90                    },
 91                    { "type": "string", "minLength": 1 },
 92                    { "type": "null" }
 93                  ]
 94                },
 95                "furtherInfo": { "type": ["string", "null"], "minLength": 1 },
 96                "wordOfWarning": { "type": ["string", "null"], "minLength": 1 },
 97                "alternativeTo": {
 98                  "oneOf": [
 99                    {
100                      "type": "array",
101                      "items": { "type": "string", "minLength": 1, "maxLength": 100 },
102                      "minItems": 1
103                    },
104                    { "type": "null" }
105                  ]
106                }
107              },
108              "required": ["name", "services"],
109              "additionalProperties": false
110            }
111          }
112        },
113        "required": ["name", "sections"],
114        "additionalProperties": false
115      }
116    }
117  },
118  "required": ["categories"],
119  "additionalProperties": false
120}