You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assigning a property on a request/response model on the swagger spec as readOnly: true converts that property into an Optional: true and Computed: true property.
There doesn't appear to be any way to set a property with just Computed: true.
Example:
With the swaggercodegen example, run terraform providers schema -json
The computed input property for the swaggercodegen_cdn_v1 resource is marked as computed and optional
It would be useful to have a method to mark a property as computed-only. Usually these would be readOnly properties from the swagger spec, but it looks like that's reserved for computed+optional properties, so perhaps an additional custom x-terraform-* field would be useful.
Acceptance criteria
The plugin has some means by which a non-optional computed property can be created on the output schema.
Additional context
The reason I have requested this is because I am looking to auto-generate terraform registry docs using the terraform-plugin-docs tool, and the fields that should be under the "Read Only" section appear under "Optional" instead, which doesn't really make sense for properties that are meant to only be read.
Semantically, a non-optional computed is the equivalent to a required readonly supported by OpenAPI v3, which is for properties you are guaranteed to see on a response.
Checklist (for admin only)
Don't forget to go through the checklist to make sure the issue is created properly:
I have added a corresponding label (feature request) to the issue (right side menu)
I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
The text was updated successfully, but these errors were encountered:
arjunrajshekhar
changed the title
readOnly becomes optional computed instead of computed
Support for computed only properties
Jan 28, 2022
arjunrajshekhar
changed the title
Support for computed only properties
Support for computed-only properties
Jan 28, 2022
arjunrajshekhar
changed the title
Support for computed-only properties
Support for computed non-optional properties
Jan 28, 2022
Is your feature request related to a problem?
Assigning a property on a request/response model on the swagger spec as
readOnly: true
converts that property into anOptional: true
andComputed: true
property.There doesn't appear to be any way to set a property with just
Computed: true
.Example:
With the swaggercodegen example, run
terraform providers schema -json
The
computed
input property for theswaggercodegen_cdn_v1
resource is marked as computed and optionalDescribe the solution you'd like
It would be useful to have a method to mark a property as computed-only. Usually these would be
readOnly
properties from the swagger spec, but it looks like that's reserved for computed+optional properties, so perhaps an additional customx-terraform-*
field would be useful.Acceptance criteria
The plugin has some means by which a non-optional computed property can be created on the output schema.
Additional context
The reason I have requested this is because I am looking to auto-generate terraform registry docs using the
terraform-plugin-docs
tool, and the fields that should be under the "Read Only" section appear under "Optional" instead, which doesn't really make sense for properties that are meant to only be read.Semantically, a non-optional computed is the equivalent to a required readonly supported by OpenAPI v3, which is for properties you are guaranteed to see on a response.
Checklist (for admin only)
Don't forget to go through the checklist to make sure the issue is created properly:
The text was updated successfully, but these errors were encountered: