mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-19 02:39:17 -05:00
Previously, the `providers schema -json` output would include the root object from `metadata functions -json`. This object had its own `format_version` property, which would be confusing with the root `format_version` property already present.
This change still uses the `jsonfunction` package for consistency between cty and provider function JSON handling, but removes that extra object, instead making `functions` directly a mapping of names to signatures/definitions. This also adds a code comment to hint maintainers that jsonprovider format versioning is tied to jsonfunction format versioning.
Example output prior to change:
```jsonc
{
"format_version": "1.0",
"provider_schemas": {
"registry.terraform.io/bflad/framework": {
// ...
"functions": {
"format_version": "1.0",
"function_signatures": {
"example": {
"description": "Echoes given argument as result",
"summary": "Example function",
"return_type": "string",
"parameters": [
{
"name": "input",
"description": "String to echo",
"type": "string"
}
]
}
}
}
}
}
}
```
Example output after change:
```jsonc
{
"format_version": "1.0",
"provider_schemas": {
"registry.terraform.io/bflad/framework": {
// ...
"functions": {
"example": {
"description": "Echoes given argument as result",
"summary": "Example function",
"return_type": "string",
"parameters": [
{
"name": "input",
"description": "String to echo",
"type": "string"
}
]
}
}
}
}
}
```
|
||
|---|---|---|
| .. | ||
| attribute.go | ||
| attribute_test.go | ||
| block.go | ||
| block_test.go | ||
| doc.go | ||
| provider.go | ||
| provider_test.go | ||
| schema.go | ||
| schema_test.go | ||