Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions schemas/common/db/full/v3.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$id": "https://mapcolonies.com/common/db/full/v3",
"description": "The full database schema including schema and database name",
"type": "object",
"allOf": [
{
"$ref": "https://mapcolonies.com/common/db/partial/v2"
},
{
"$ref": "#/definitions/db"
}
],
"unevaluatedProperties": true,
"definitions": {
"db": {
"type": "object",
"required": ["database"],
"properties": {
"schema": {
"type": "string",
"description": "The schema name of the database",
"default": "public",
"x-env-value": "DB_SCHEMA"
},
"database": {
"type": "string",
"description": "The database name",
"maxLength": 63,
"x-env-value": "DB_NAME"
}
}
}
}
}
10 changes: 10 additions & 0 deletions schemas/common/db/partial/v2.configs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name": "db-connection",
"value": {
"ssl": {
"enabled": false
}
}
}
]
83 changes: 83 additions & 0 deletions schemas/common/db/partial/v2.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"$id": "https://mapcolonies.com/common/db/partial/v2",
"description": "database configuration for postgres",
"type": "object",
"required": ["ssl"],
"properties": {
"host": {
"type": "string",
"description": "the host of the database",
"default": "localhost",
"x-env-value": "DB_HOST"
},
"port": {
"type": "integer",
"description": "the port of the database",
"default": 5432,
"x-env-value": "DB_PORT"
},
"username": {
"type": "string",
"description": "the username of the database",
"default": "postgres",
"maxLength": 63,
"x-env-value": "DB_USERNAME"
},
"password": {
"type": "string",
"description": "the password of the database",
"default": "postgres",
"x-env-value": "DB_PASSWORD"
},
"ssl": {
"$ref": "#/definitions/ssl"
}
},
"definitions": {
"ssl": {
"type": "object",
"description": "ssl configuration",
"properties": {
"enabled": {
"type": "boolean",
"description": "enable ssl",
"default": false,
"x-env-value": "DB_ENABLE_SSL_AUTH"
},
"ca": {
"type": "string",
"description": "the path to the ca file",
"x-env-value": "DB_CA_PATH"
},
"cert": {
"type": "string",
"description": "the path to the cert file",
"x-env-value": "DB_CERT_PATH"
},
"key": {
"type": "string",
"description": "the path to the key file",
"x-env-value": "DB_KEY_PATH"
}
},
"unevaluatedProperties": false,
"if": {
"properties": {
"enabled": {
"const": true
}
}
},
"then": {
"required": ["cert", "key"]
},
"else": {
"properties": {
"enabled": {
"const": false
}
}
}
}
}
}
40 changes: 40 additions & 0 deletions schemas/vector/vectorStandard/api/v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$id": "https://mapcolonies.com/vector/vectorStandard/api/v1",
"type": "object",
"title": "vectorStandardApiSchemaV1",
"description": "Vector's standard API schema",
"allOf": [
{
"$ref": "https://mapcolonies.com/common/boilerplate/v2"
},
{
"$ref": "#/definitions/databases"
}
],
"definitions": {
"databases": {
"type": "object",
"required": ["db"],
"properties": {
"db": {
"allOf": [
{
"$ref": "https://mapcolonies.com/common/db/full/v3"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"x-env-value": "DB_TYPE",
"default": "postgres"
}
},
"required": ["type"]
}
]
}
}
}
}
}
37 changes: 37 additions & 0 deletions schemas/vector/vectorStandard/common/v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$id": "https://mapcolonies.com/vector/vectorStandard/common/v1",
"type": "object",
"title": "vectorStandardCommonSchemaV1",
"description": "Vector's standard common DB schema",
"allOf": [
{
"$ref": "#/definitions/databases"
}
],
"definitions": {
"databases": {
"type": "object",
"required": ["db"],
"properties": {
"db": {
"allOf": [
{
"$ref": "https://mapcolonies.com/common/db/full/v3"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"x-env-value": "DB_TYPE",
"default": "postgres"
}
},
"required": ["type"]
}
]
}
}
}
}
}
Loading
Loading