We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
github.com/hashicorp/terraform-plugin-framework v1.9.0
Omit arguments in provider functions when the default is already the correct value.
e.g. My provider function has a filename argument that often is the same value: .env
.env
Setting defaults to provider functions in the Plugin Framework does not work or I was not able to.
Provide a additional Default key to the function definition to specify a default value to a parameter:
Default
func (r ExampleFunction) Definition(_ context.Context, _ function.DefinitionRequest, resp *function.DefinitionResponse) { resp.Definition = function.Definition{ Summary: "Example function", MarkdownDescription: "Foo bar", Parameters: []function.Parameter{ function.StringParameter{ Name: "filename", MarkdownDescription: "Path to the dotenv file", // Add this Default: ".env", }, }, Return: function.StringReturn{}, } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Module version
Use-cases
Omit arguments in provider functions when the default is already the correct value.
e.g. My provider function has a filename argument that often is the same value:
.env
Attempted Solutions
Setting defaults to provider functions in the Plugin Framework does not work or I was not able to.
Proposal
Provide a additional
Default
key to the function definition to specify a default value to a parameter:References
The text was updated successfully, but these errors were encountered: