pulumi/pkg/codegen/internal/test/testdata/env-helper/schema.json
Ian Wahbe 3e2f36548e
[codegen/typescript] Call site defaults for plain Pulumi Object types (#8400)
* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add required+default test case

* Don't `<any>` cast known types.

* Add plain object to env-helper test

This test fails right now. My next problem is fixing it.

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Add missing change to fix test

* Run tests with merge

* Merge in next _index.md diff

* Another attempt at _index.md

* Make module generation deterministic

* Fix docs generation

Credit to @praneetloke
2021-11-18 12:23:30 -08:00

235 lines
6.2 KiB
JSON

{
"version": "0.0.1",
"name": "example",
"provider": {
"description": "The provider type for the kubernetes package.",
"type": "object",
"inputProperties": {
"helmReleaseSettings": {
"$ref": "#/types/example:index:HelmReleaseSettings",
"description": "BETA FEATURE - Options to configure the Helm Release resource."
}
}
},
"resources": {
"example:index:Foo": {
"description": "test new feature with resoruces",
"inputProperties": {
"argument": {
"type": "string",
"plain": true
},
"settings": {
"$ref": "#/types/example:index:LayeredType",
"description": "describing things"
},
"kubeClientSettings": {
"$ref": "#/types/example:index:KubeClientSettings",
"description": "Options for tuning the Kubernetes client used by a Provider."
},
"backupKubeClientSettings": {
"$ref": "#/types/example:index:KubeClientSettings",
"description": "Options for tuning the Kubernetes client used by a Provider."
}
},
"properties": {
"defaultKubeClientSettings": {
"$ref": "#/types/example:index:KubeClientSettings",
"description": "A test for plain types",
"plain": true
}
},
"requiredInputs": ["backupKubeClientSettings"]
},
"example:index:moduleTest": {
"inputProperties": {
"val": {
"$ref": "#/types/example:index:typ"
},
"mod1": {
"$ref": "#/types/example:mod1:typ"
}
}
}
},
"types": {
"example:mod1:typ": {
"description": "A test for namespaces (mod 1)",
"properties": {
"val": {
"type": "string",
"default": "mod1"
}
},
"type": "object"
},
"example:mod2:typ": {
"description": "A test for namespaces (mod 2)",
"properties": {
"val": {
"type": "string",
"default": "mod2"
},
"mod1": {
"$ref": "#/types/example:mod1:typ"
}
},
"type": "object"
},
"example:index:typ": {
"description": "A test for namespaces (mod main)",
"properties": {
"val": {
"type": "string",
"default": "mod main"
},
"mod1": {
"$ref": "#/types/example:mod1:typ"
},
"mod2": {
"$ref": "#/types/example:mod2:typ"
}
},
"type": "object"
},
"example:index:HelmReleaseSettings": {
"description": "BETA FEATURE - Options to configure the Helm Release resource.",
"properties": {
"driver": {
"type": "string",
"description": "The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
"default": "secret",
"defaultInfo": {
"environment": ["PULUMI_K8S_HELM_DRIVER"]
}
},
"pluginsPath": {
"type": "string",
"description": "The path to the helm plugins directory.",
"defaultInfo": {
"environment": ["PULUMI_K8S_HELM_PLUGINS_PATH"]
}
},
"requiredArg": {
"type": "string",
"description": "to test required args"
}
},
"required": ["requiredArg"],
"type": "object"
},
"example:index:LayeredType": {
"description": "Make sure that defaults propagate through types",
"type": "object",
"properties": {
"answer": {
"description": "The answer to the question",
"type": "number",
"default": 42
},
"question": {
"description": "The question already answered",
"type": "string",
"default": "<unknown>",
"defaultInfo": {
"environment": ["PULUMI_THE_QUESTION"]
}
},
"thinker": {
"description": "To ask and answer",
"type": "string",
"default": "not a good interaction"
},
"other": {
"$ref": "#/types/example:index:HelmReleaseSettings"
},
"plainOther": {
"description": "Test how plain types interact",
"$ref": "#/types/example:index:HelmReleaseSettings",
"plain": true
},
"recursive": {
"$ref": "#/types/example:index:LayeredType"
}
},
"required": ["other", "thinker"]
},
"example:index:KubeClientSettings": {
"description": "Options for tuning the Kubernetes client used by a Provider.",
"properties": {
"burst": {
"type": "integer",
"description": "Maximum burst for throttle. Default value is 10.",
"defaultInfo": {
"environment": ["PULUMI_K8S_CLIENT_BURST"]
}
},
"qps": {
"type": "number",
"description": "Maximum queries per second (QPS) to the API server from this client. Default value is 5.",
"defaultInfo": {
"environment": ["PULUMI_K8S_CLIENT_QPS"]
}
},
"recTest": {
"$ref": "#/types/example:index:KubeClientSettings"
}
},
"type": "object"
}
},
"functions": {
"mypkg::funcWithAllOptionalInputs": {
"description": "Check codegen of functions with all optional inputs.",
"inputs": {
"type": "object",
"properties": {
"a": {
"$ref": "#/types/example:index:HelmReleaseSettings",
"description": "Property A"
},
"b": {
"type": "string",
"description": "Property B",
"default": "defValue"
}
}
},
"outputs": {
"properties": {
"r": {
"type": "string"
}
},
"type": "object",
"required": ["r"]
}
}
},
"language": {
"csharp": {
"packageReferences": {
"Pulumi": "3.12"
}
},
"go": {
"importBasePath": "env-helper/example"
},
"nodejs": {
"dependencies": {
"@pulumi/pulumi": "^3.12"
},
"devDependencies": {
"typescript": "^3.7.0"
}
},
"python": {}
}
}