Skip to content

Instantly share code, notes, and snippets.

@Satak
Created October 10, 2023 19:11
Show Gist options
  • Save Satak/e7cddd1095ca3c18d494e869d77e53f2 to your computer and use it in GitHub Desktop.
Save Satak/e7cddd1095ca3c18d494e869d77e53f2 to your computer and use it in GitHub Desktop.
json schema
my-data-123:
is_enabled: true
amount: 100
tier: premium
subnets:
- item
tags:
test: test-tag
{
"type": "object",
"propertyNames": {
"pattern": "^[a-z0-9-]+$"
},
"patternProperties": {
"^[a-z0-9-]+$": {
"type": "object",
"properties": {
"is_enabled": {
"type": "boolean",
"default": true
},
"description": {
"type": "string",
"maxLength": 50
},
"amount": {
"type": "integer",
"minimum": 0,
"maximum": 100,
"default": 25
},
"tier": {
"type": "string",
"default": "standard",
"enum": [
"standard",
"premium"
]
},
"subnets": {
"oneOf": [
{
"type": "null"
},
{
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
]
},
"tags": {
"type": "object",
"propertyNames": {
"pattern": "^[a-z0-9-]+$"
},
"patternProperties": {
"^[a-z0-9-]+$": {
"type": "string"
}
}
}
},
"required": [
"is_enabled",
"amount",
"tier"
],
"additionalProperties": false
}
}
}
{
"yaml.schemas": {
"./schemas/schema.json": [
"/tf/config/**/*.yaml"
],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment