Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nesting default values inline #13

Merged
merged 7 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var rootCmd = &cobra.Command{
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
rootCmd.AddCommand(NewCmdBicep())
rootCmd.AddCommand(NewCmdHelm())
rootCmd.AddCommand(NewCmdOpenTofu())
rootCmd.AddCommand(NewCmdValidate())
Expand Down
295 changes: 200 additions & 95 deletions pkg/opentofu/testdata/opentofu/simple/schema.json
Original file line number Diff line number Diff line change
@@ -1,97 +1,202 @@
{
"required": [
"nodescription",
"testbool",
"testemptybool",
"testlist",
"testmap",
"testnumber",
"testobject",
"testset",
"teststring"
],
"properties": {
"teststring": {
"title": "teststring",
"type": "string",
"description": "An example string variable",
"default": "string value"
},
"testnumber": {
"title": "testnumber",
"type": "number",
"description": "An example number variable",
"default": 20
},
"testbool": {
"title": "testbool",
"type": "boolean",
"description": "An example bool variable",
"default": false
},
"testemptybool": {
"title": "testemptybool",
"type": "boolean",
"description": "An example empty bool variable",
"default": false
},
"testobject": {
"title": "testobject",
"type": "object",
"properties": {
"name": {
"title": "name",
"type": "string"
},
"address": {
"title": "address",
"type": "string"
},
"age": {
"title": "age",
"type": "number"
}
},
"required": [
"name"
],
"description": "An example object variable",
"default": {
"name": "Bob",
"address": "123 Bob St."
}
},
"testlist": {
"title": "testlist",
"type": "array",
"description": "An example list variable",
"items": {
"type": "string"
}
},
"testset": {
"title": "testset",
"type": "array",
"uniqueItems": true,
"description": "An example set variable",
"items": {
"type": "string"
}
},
"testmap": {
"title": "testmap",
"type": "object",
"description": "An example map variable",
"propertyNames": {
"pattern": "^.*$"
},
"additionalProperties": {
"type": "string"
}
},
"nodescription": {
"title": "nodescription",
"type": "string"
}
}
"required": [
"nodescription",
"testbool",
"testemptybool",
"testlist",
"testmap",
"testnestedobject",
"testnumber",
"testobject",
"testset",
"teststring"
],
"properties": {
"teststring": {
"title": "teststring",
"type": "string",
"description": "An example string variable",
"default": "string value"
},
"testnumber": {
"title": "testnumber",
"type": "number",
"description": "An example number variable",
"default": 20
},
"testbool": {
"title": "testbool",
"type": "boolean",
"description": "An example bool variable",
"default": false
},
"testemptybool": {
"title": "testemptybool",
"type": "boolean",
"description": "An example empty bool variable",
"default": false
},
"testobject": {
"title": "testobject",
"type": "object",
"properties": {
"name": {
"title": "name",
"type": "string"
},
"address": {
"title": "address",
"type": "string"
},
"age": {
"title": "age",
"type": "number"
}
},
"required": [
"name"
],
"description": "An example object variable",
"default": {
"name": "Bob",
"address": "123 Bob St."
}
},
"testnestedobject": {
"title": "testnestedobject",
"description": "An example nested object variable",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"title": "name",
"type": "string"
},
"address": {
"title": "address",
"type": "string",
"default": "123 Bob St."
},
"age": {
"title": "age",
"type": "number",
"default": 30
},
"dead": {
"title": "dead",
"type": "boolean",
"default": false
},
"phones": {
"title": "phones",
"type": "object",
"default": {
"home": "987-654-3210"
},
"required": [
"home"
],
"properties": {
"home": {
"title": "home",
"type": "string"
},
"work": {
"title": "work",
"type": "string",
"default": "123-456-7891"
}
}
},
"children": {
"title": "children",
"type": "array",
"default": [
{
"name": "bob",
"occupation": {
"company": "none",
"experience": 2,
"manager": true
}
}
],
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"title": "name",
"type": "string"
},
"occupation": {
"title": "occupation",
"type": "object",
"default": {
"company": "Massdriver",
"experience": 1,
"manager": false
},
"required": [
"company"
],
"properties": {
"company": {
"title": "company",
"type": "string"
},
"experience": {
"title": "experience",
"type": "number",
"default": 0
},
"manager": {
"title": "manager",
"type": "boolean",
"default": false
}
}
}
}
}
}
}
},
"testlist": {
"title": "testlist",
"type": "array",
"description": "An example list variable",
"items": {
"type": "string"
}
},
"testset": {
"title": "testset",
"type": "array",
"uniqueItems": true,
"description": "An example set variable",
"items": {
"type": "string"
}
},
"testmap": {
"title": "testmap",
"type": "object",
"description": "An example map variable",
"propertyNames": {
"pattern": "^.*$"
},
"additionalProperties": {
"type": "string"
}
},
"nodescription": {
"title": "nodescription",
"type": "string"
}
}
}
Loading