diff --git a/go.mod b/go.mod index 88ae35a..759903f 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/defenseunicorns/maru-runner go 1.21.8 require ( - github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b github.com/defenseunicorns/pkg/exec v0.0.1 github.com/defenseunicorns/pkg/helpers/v2 v2.0.1 github.com/goccy/go-yaml v1.11.3 + github.com/invopop/jsonschema v0.12.0 github.com/pterm/pterm v0.12.79 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 @@ -17,6 +17,8 @@ require ( atomicgo.dev/cursor v0.2.0 // indirect atomicgo.dev/keyboard v0.2.9 // indirect atomicgo.dev/schedule v0.1.0 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/defenseunicorns/pkg/helpers v1.1.1 // indirect @@ -26,11 +28,11 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/gookit/color v1.5.4 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -48,6 +50,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.22.0 // indirect diff --git a/go.sum b/go.sum index 119df2d..b9937e7 100644 --- a/go.sum +++ b/go.sum @@ -15,9 +15,11 @@ github.com/MarvinJWendt/testza v0.3.0/go.mod h1:eFcL4I0idjtIx8P9C6KkAuLgATNKpX4/ github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYewEjXsvsVUPbE= github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4= github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY= -github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b h1:doCpXjVwui6HUN+xgNsNS3SZ0/jUZ68Eb+mJRNOZfog= -github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60= github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= @@ -56,10 +58,11 @@ github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= +github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= @@ -79,6 +82,8 @@ github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8 github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -136,7 +141,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -147,6 +151,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= diff --git a/hack/generate-schema.sh b/hack/generate-schema.sh index 83bd731..cbace7c 100755 --- a/hack/generate-schema.sh +++ b/hack/generate-schema.sh @@ -4,11 +4,20 @@ go run main.go internal config-tasks-schema > tasks.schema.json # Adds pattern properties to all definitions to allow for yaml extensions -jq '.definitions |= map_values(. + {"patternProperties": {"^x-": {}}})' tasks.schema.json > temp_tasks.schema.json -mv temp_tasks.schema.json tasks.schema.json +jq ' + def addPatternProperties: + . + + if has("properties") then + {"patternProperties": {"^x-": {}}} + else + {} + end; + + walk(if type == "object" then addPatternProperties else . end) +' tasks.schema.json > temp_tasks.schema.json -# Modifies pattern properties to allow input parameters -jq '.definitions.Task.properties.inputs.patternProperties = {"^[_a-zA-Z][a-zA-Z0-9_-]*$": {"$schema": "http://json-schema.org/draft-04/schema#","$ref": "#/definitions/InputParameter"}}' tasks.schema.json > temp_tasks.schema.json mv temp_tasks.schema.json tasks.schema.json -jq '.definitions.Action.properties.with.patternProperties = {"^[_a-zA-Z][a-zA-Z0-9_-]*$": {"additionalProperties": true}}' tasks.schema.json > temp_tasks.schema.json + +awk '{gsub(/\[github\.com\/defenseunicorns\/maru-runner\/src\/pkg\/variables\.ExtraVariableInfo\]/, ""); print}' tasks.schema.json > temp_tasks.schema.json + mv temp_tasks.schema.json tasks.schema.json diff --git a/src/cmd/internal.go b/src/cmd/internal.go index 4c2a6b8..7ebab09 100644 --- a/src/cmd/internal.go +++ b/src/cmd/internal.go @@ -8,10 +8,10 @@ import ( "encoding/json" "fmt" - "github.com/alecthomas/jsonschema" "github.com/defenseunicorns/maru-runner/src/config/lang" "github.com/defenseunicorns/maru-runner/src/message" "github.com/defenseunicorns/maru-runner/src/types" + "github.com/invopop/jsonschema" "github.com/spf13/cobra" ) diff --git a/src/pkg/variables/types.go b/src/pkg/variables/types.go index 0819588..5e96f14 100644 --- a/src/pkg/variables/types.go +++ b/src/pkg/variables/types.go @@ -17,7 +17,7 @@ const ( type Variable[T any] struct { Name string `json:"name" jsonschema:"description=The name to be used for the variable,pattern=^[A-Z0-9_]+$"` Pattern string `json:"pattern,omitempty" jsonschema:"description=An optional regex pattern that a variable value must match before a package deployment can continue."` - Extra T `json:",inline"` + Extra T `json:",omitempty,inline"` } // InteractiveVariable is a variable that can be used to prompt a user for more information diff --git a/src/test/tasks/even-more-tasks-to-import.yaml b/src/test/tasks/even-more-tasks-to-import.yaml index f1d8fde..2857649 100644 --- a/src/test/tasks/even-more-tasks-to-import.yaml +++ b/src/test/tasks/even-more-tasks-to-import.yaml @@ -5,4 +5,3 @@ tasks: echo "defenseunicorns" setVariables: - name: PRETTY_OK_COMPANY - sensitive: false diff --git a/src/test/tasks/tasks.yaml b/src/test/tasks/tasks.yaml index 8df22b7..6959999 100644 --- a/src/test/tasks/tasks.yaml +++ b/src/test/tasks/tasks.yaml @@ -13,7 +13,6 @@ variables: - name: COOL_DIR default: src/test/tasks - name: COOL_FILE - type: file default: my-env tasks: @@ -57,7 +56,6 @@ tasks: mute: true setVariables: - name: ACTION_VAR - sensitive: true - cmd: echo "I'm set from setVariables - ${ACTION_VAR}" - cmd: echo "I'm set from a runner var - ${REPLACE_ME}" - cmd: echo "I'm set from a --set var - ${REPLACE_ME}" diff --git a/tasks.schema.json b/tasks.schema.json index 37c56f2..0eedb91 100644 --- a/tasks.schema.json +++ b/tasks.schema.json @@ -1,25 +1,63 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/TasksFile", - "definitions": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/defenseunicorns/maru-runner/src/types/tasks-file", + "$ref": "#/$defs/TasksFile", + "$defs": { "Action": { - "required": [ - "BaseAction" - ], "properties": { - "BaseAction": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/BaseAction[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]" + "description": { + "type": "string", + "description": "Description of the action to be displayed during package execution instead of the command" + }, + "cmd": { + "type": "string", + "description": "The command to run. Must specify either cmd or wait for the action to do anything." + }, + "wait": { + "$ref": "#/$defs/ActionWait", + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action." + }, + "env": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Additional environment variables to set for the command" + }, + "mute": { + "type": "boolean", + "description": "Hide the output of the command during package deployment (default false)" + }, + "maxTotalSeconds": { + "type": "integer", + "description": "Timeout in seconds for the command (default to 0" + }, + "maxRetries": { + "type": "integer", + "description": "Retry the command if it fails up to given number of times (default 0)" + }, + "dir": { + "type": "string", + "description": "The working directory to run the command in (default is CWD)" + }, + "shell": { + "$ref": "#/$defs/ShellPreference", + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems" + }, + "setVariables": { + "items": { + "$ref": "#/$defs/Variable" + }, + "type": "array", + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package." }, "task": { "type": "string", "description": "The task to run" }, "with": { - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "additionalProperties": true - } + "additionalProperties": { + "type": "string" }, "type": "object", "description": "Input parameters to pass to the task" @@ -34,13 +72,11 @@ "ActionWait": { "properties": { "cluster": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ActionWaitCluster", + "$ref": "#/$defs/ActionWaitCluster", "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified." }, "network": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ActionWaitNetwork", + "$ref": "#/$defs/ActionWaitNetwork", "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified." } }, @@ -51,10 +87,6 @@ } }, "ActionWaitCluster": { - "required": [ - "kind", - "name" - ], "properties": { "kind": { "type": "string", @@ -87,23 +119,23 @@ }, "additionalProperties": false, "type": "object", + "required": [ + "kind", + "name" + ], "patternProperties": { "^x-": {} } }, "ActionWaitNetwork": { - "required": [ - "protocol", - "address" - ], "properties": { "protocol": { + "type": "string", "enum": [ "tcp", "http", "https" ], - "type": "string", "description": "The protocol to wait for" }, "address": { @@ -125,63 +157,10 @@ }, "additionalProperties": false, "type": "object", - "patternProperties": { - "^x-": {} - } - }, - "BaseAction[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]": { - "properties": { - "description": { - "type": "string", - "description": "Description of the action to be displayed during package execution instead of the command" - }, - "cmd": { - "type": "string", - "description": "The command to run. Must specify either cmd or wait for the action to do anything." - }, - "wait": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ActionWait", - "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action." - }, - "env": { - "items": { - "type": "string" - }, - "type": "array", - "description": "Additional environment variables to set for the command" - }, - "mute": { - "type": "boolean", - "description": "Hide the output of the command during package deployment (default false)" - }, - "maxTotalSeconds": { - "type": "integer", - "description": "Timeout in seconds for the command (default to 0" - }, - "maxRetries": { - "type": "integer", - "description": "Retry the command if it fails up to given number of times (default 0)" - }, - "dir": { - "type": "string", - "description": "The working directory to run the command in (default is CWD)" - }, - "shell": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ShellPreference", - "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems" - }, - "setVariables": { - "items": { - "$ref": "#/definitions/Variable[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]" - }, - "type": "array", - "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package." - } - }, - "additionalProperties": false, - "type": "object", + "required": [ + "protocol", + "address" + ], "patternProperties": { "^x-": {} } @@ -195,9 +174,6 @@ } }, "InputParameter": { - "required": [ - "description" - ], "properties": { "description": { "type": "string", @@ -209,7 +185,8 @@ }, "required": { "type": "boolean", - "description": "Whether the parameter is required" + "description": "Whether the parameter is required", + "default": true }, "default": { "type": "string", @@ -218,18 +195,26 @@ }, "additionalProperties": false, "type": "object", + "required": [ + "description" + ], "patternProperties": { "^x-": {} } }, - "InteractiveVariable[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]": { - "required": [ - "Variable" - ], + "InteractiveVariable": { "properties": { - "Variable": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Variable[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]" + "name": { + "type": "string", + "pattern": "^[A-Z0-9_]+$", + "description": "The name to be used for the variable" + }, + "pattern": { + "type": "string", + "description": "An optional regex pattern that a variable value must match before a package deployment can continue." + }, + "Extra": { + "$ref": "#/$defs/ExtraVariableInfo" }, "description": { "type": "string", @@ -246,6 +231,9 @@ }, "additionalProperties": false, "type": "object", + "required": [ + "name" + ], "patternProperties": { "^x-": {} } @@ -294,9 +282,6 @@ } }, "Task": { - "required": [ - "name" - ], "properties": { "name": { "type": "string", @@ -308,18 +293,14 @@ }, "actions": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Action" + "$ref": "#/$defs/Action" }, "type": "array", "description": "Actions to take when running the task" }, "inputs": { - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/InputParameter" - } + "additionalProperties": { + "$ref": "#/$defs/InputParameter" }, "type": "object", "description": "Input parameters for the task" @@ -331,21 +312,19 @@ }, "additionalProperties": false, "type": "object", + "required": [ + "name" + ], "patternProperties": { "^x-": {} } }, "TasksFile": { - "required": [ - "tasks" - ], "properties": { "includes": { "items": { - "patternProperties": { - ".*": { - "type": "string" - } + "additionalProperties": { + "type": "string" }, "type": "object" }, @@ -354,16 +333,14 @@ }, "variables": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/InteractiveVariable[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]" + "$ref": "#/$defs/InteractiveVariable" }, "type": "array", "description": "Definitions and default values for variables used in run.yaml" }, "tasks": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Task" + "$ref": "#/$defs/Task" }, "type": "array", "description": "The list of tasks that can be run" @@ -371,19 +348,18 @@ }, "additionalProperties": false, "type": "object", + "required": [ + "tasks" + ], "patternProperties": { "^x-": {} } }, - "Variable[github.com/defenseunicorns/maru-runner/src/pkg/variables.ExtraVariableInfo]": { - "required": [ - "name", - "Extra" - ], + "Variable": { "properties": { "name": { - "pattern": "^[A-Z0-9_]+$", "type": "string", + "pattern": "^[A-Z0-9_]+$", "description": "The name to be used for the variable" }, "pattern": { @@ -391,12 +367,14 @@ "description": "An optional regex pattern that a variable value must match before a package deployment can continue." }, "Extra": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ExtraVariableInfo" + "$ref": "#/$defs/ExtraVariableInfo" } }, "additionalProperties": false, "type": "object", + "required": [ + "name" + ], "patternProperties": { "^x-": {} }