servers.schema.json 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/servers.schema.json",
  4. "title": "LinuxGSM server metadata",
  5. "type": "object",
  6. "required": ["schemaVersion", "servers"],
  7. "additionalProperties": false,
  8. "properties": {
  9. "$schema": { "type": "string" },
  10. "schemaVersion": { "const": 1 },
  11. "servers": {
  12. "type": "object",
  13. "propertyNames": { "pattern": "^[a-z0-9]+server$" },
  14. "additionalProperties": { "$ref": "#/$defs/server" }
  15. }
  16. },
  17. "$defs": {
  18. "server": {
  19. "type": "object",
  20. "required": ["ports"],
  21. "additionalProperties": false,
  22. "properties": {
  23. "ports": {
  24. "type": "array",
  25. "items": { "$ref": "#/$defs/port" }
  26. }
  27. }
  28. },
  29. "port": {
  30. "type": "object",
  31. "required": ["label", "variable", "default", "protocols"],
  32. "additionalProperties": false,
  33. "properties": {
  34. "label": { "type": "string", "minLength": 1 },
  35. "variable": { "type": "string", "pattern": "^[a-z0-9]+$" },
  36. "default": {
  37. "oneOf": [
  38. { "type": "integer", "minimum": 1, "maximum": 65535 },
  39. { "type": "null" }
  40. ]
  41. },
  42. "protocols": {
  43. "type": "array",
  44. "minItems": 1,
  45. "uniqueItems": true,
  46. "items": { "enum": ["tcp", "udp"] }
  47. },
  48. "note": { "type": "string", "minLength": 1 }
  49. }
  50. }
  51. }
  52. }