Skip to content

Commit

Permalink
Merge pull request #8 from partofmyid/SX-9-patch-1
Browse files Browse the repository at this point in the history
schema validation
  • Loading branch information
SX-9 authored Oct 25, 2024
2 parents d419566 + e37e936 commit 8711917
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ jobs:
pattern: "\\.json$"
env:
BASE: "domains/"
# NOTE: wait for wildcard support
# - name: Validate JSON Schema
# uses: docker://orrosenblatt/validate-json-action:latest
# env:
# INPUT_SCHEMA: "schema.json"
# INPUT_JSONS: "domains/*"
84 changes: 84 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"type": "object",
"properties": {
"description": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"username": {
"type": "string"
}
},
"required": ["username"]
},
"record": {
"type": "object",
"properties": {
"A": {
"type": "array",
"items": {
"type": "string",
"format": "ipv4"
}
},
"AAAA": {
"type": "array",
"items": {
"type": "string",
"format": "ipv6"
}
},
"CNAME": {
"type": "string"
},
"MX": {
"type": "array",
"items": {
"type": "string"
}
},
"TXT": {
"type": "array",
"items": {
"type": "string"
}
},
"SRV": {
"type": "array",
"items": {
"type": "object",
"properties": {
"priority": {
"type": "integer"
},
"weight": {
"type": "integer"
},
"port": {
"type": "integer"
},
"target": {
"type": "string"
}
},
"required": ["priority", "weight", "port", "target"]
}
}
},
"anyOf": [
{ "required": ["A"] },
{ "required": ["AAAA"] },
{ "required": ["CNAME"] },
{ "required": ["MX"] },
{ "required": ["TXT"] },
{ "required": ["SRV"] }
]
},
"proxied": {
"type": "boolean"
}
},
"required": ["owner", "record", "proxied"]
}

0 comments on commit 8711917

Please sign in to comment.