hashicorp / terraform-plugin-codegen-openapi

OpenAPI to Terraform Provider Code Generation Specification
Mozilla Public License 2.0
49 stars 9 forks source link

Determine Computability Behavior When Required + Default #38

Closed bflad closed 1 year ago

bflad commented 1 year ago

As a followup to the initial default property handling implementation from https://github.com/hashicorp/terraform-plugin-codegen-openapi/issues/31, where the output specification can become:

            "schema": {
                "attributes": [
                    {
                        "name": "arch",
                        "string": {
                            "computed_optional_required": "required",
                            "default": {
                                "static": "x86_64"
                            },

Typically in Terraform, these would be represented as optional and computed so practitioners can omit the value and receive the default value. The other option is dropping the default and leaving it required.

I think the optional+computed behavior is generally preferable, but it may make sense to decide if the behavior needs to be configurable from that choice or wait to see if there are feature requests for that use case.

github-actions[bot] commented 3 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.