mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat!: Validate monotonic numbers for rich parameters (#6046)
* Database changes * protobuf * Fix: docs * workspaces_test * Validation in coderd * Fix: resources * omitempty * UI changes * UI tests * fix
This commit is contained in:
87
coderd/apidoc/docs.go
generated
87
coderd/apidoc/docs.go
generated
@ -2636,7 +2636,7 @@ const docTemplate = `{
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/parameter.ComputedValue"
|
||||
"$ref": "#/definitions/codersdk.TemplateVersionParameter"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7543,6 +7543,80 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TemplateVersionParameter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default_value": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"mutable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.TemplateVersionParameterOption"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"string",
|
||||
"number",
|
||||
"bool"
|
||||
]
|
||||
},
|
||||
"validation_error": {
|
||||
"type": "string"
|
||||
},
|
||||
"validation_max": {
|
||||
"type": "integer"
|
||||
},
|
||||
"validation_min": {
|
||||
"type": "integer"
|
||||
},
|
||||
"validation_monotonic": {
|
||||
"enum": [
|
||||
"increasing",
|
||||
"decreasing"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/codersdk.ValidationMonotonicOrder"
|
||||
}
|
||||
]
|
||||
},
|
||||
"validation_regex": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TemplateVersionParameterOption": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TraceConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -7769,6 +7843,17 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.ValidationMonotonicOrder": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"increasing",
|
||||
"decreasing"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"MonotonicOrderIncreasing",
|
||||
"MonotonicOrderDecreasing"
|
||||
]
|
||||
},
|
||||
"codersdk.Workspace": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
77
coderd/apidoc/swagger.json
generated
77
coderd/apidoc/swagger.json
generated
@ -2320,7 +2320,7 @@
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/parameter.ComputedValue"
|
||||
"$ref": "#/definitions/codersdk.TemplateVersionParameter"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6781,6 +6781,73 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TemplateVersionParameter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default_value": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"mutable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.TemplateVersionParameterOption"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["string", "number", "bool"]
|
||||
},
|
||||
"validation_error": {
|
||||
"type": "string"
|
||||
},
|
||||
"validation_max": {
|
||||
"type": "integer"
|
||||
},
|
||||
"validation_min": {
|
||||
"type": "integer"
|
||||
},
|
||||
"validation_monotonic": {
|
||||
"enum": ["increasing", "decreasing"],
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/codersdk.ValidationMonotonicOrder"
|
||||
}
|
||||
]
|
||||
},
|
||||
"validation_regex": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TemplateVersionParameterOption": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TraceConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -6984,6 +7051,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.ValidationMonotonicOrder": {
|
||||
"type": "string",
|
||||
"enum": ["increasing", "decreasing"],
|
||||
"x-enum-varnames": [
|
||||
"MonotonicOrderIncreasing",
|
||||
"MonotonicOrderDecreasing"
|
||||
]
|
||||
},
|
||||
"codersdk.Workspace": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
Reference in New Issue
Block a user