Skip to content

Commit

Permalink
Add vscode schema to help defining new config
Browse files Browse the repository at this point in the history
vscode provides a way to add JSON Schema. This commit adds a JSON schema
for .config.yaml, helping development of new config files.
  • Loading branch information
thibmeu committed Jul 26, 2024
1 parent a40e3a6 commit ebf800e
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"redhat.vscode-yaml"
]
}
211 changes: 211 additions & 0 deletions .vscode/ops-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"services": {
"type": "object",
"properties": {
"attester": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"git": {
"type": "string"
},
"port": {
"type": "string"
},
"test": {
"type": "object",
"properties": {
"hostname": {
"type": "string"
},
"tlsConfig": {
"type": "object",
"properties": {
"cert": {
"type": "string"
},
"key": {
"type": "string"
}
},
"required": [
"cert",
"key"
]
}
},
"required": [
"hostname"
]
},
"deploy": {
"type": "object",
"properties": {
"wrangler": {
"type": "string"
},
"environment": {
"type": "string"
},
"envFile": {
"type": "string"
},
"immediateDeployment": {
"type": "boolean"
}
},
"required": [
"wrangler"
]
}
}
},
"issuer": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"git": {
"type": "string"
},
"port": {
"type": "string"
},
"test": {
"type": "object",
"properties": {
"hostname": {
"type": "string"
},
"tlsConfig": {
"type": "object",
"properties": {
"cert": {
"type": "string"
},
"key": {
"type": "string"
}
},
"required": [
"cert",
"key"
]
}
},
"required": [
"hostname"
]
},
"deploy": {
"type": "object",
"properties": {
"wrangler": {
"type": "string"
},
"environment": {
"type": "string"
},
"envFile": {
"type": "string"
},
"immediateDeployment": {
"type": "boolean"
}
},
"required": [
"wrangler"
]
}
}
},
"origin": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"git": {
"type": "string"
},
"port": {
"type": "string"
},
"test": {
"type": "object",
"properties": {
"hostname": {
"type": "string"
},
"tlsConfig": {
"type": "object",
"properties": {
"cert": {
"type": "string"
},
"key": {
"type": "string"
}
},
"required": [
"cert",
"key"
]
}
},
"required": [
"hostname"
]
},
"deploy": {
"type": "object",
"properties": {
"wrangler": {
"type": "string"
},
"environment": {
"type": "string"
},
"envFile": {
"type": "string"
},
"immediateDeployment": {
"type": "boolean"
}
},
"required": [
"wrangler"
]
}
}
}
},
"required": [
"attester",
"issuer",
"origin"
]
},
"config": {
"type": "object",
"properties": {
"directory": {
"type": "string"
}
},
"required": [
"directory"
]
}
},
"required": [
"services",
"config"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"yaml.schemas": {
".vscode/ops-schema.json": [
"**/*.config.yaml"
]
}
}
Loading

0 comments on commit ebf800e

Please sign in to comment.