This PR adds support for update_body_patches to the restful_resource resource. This attribute is not supposed to be used for most API providers. The only use case can be found at https://github.com/magodo/terraform-provider-restful/issues/125, where the API requires the resource ID for an update, which is only available after the creation.
Another attempt is to turn the patches into one single dynamic attribute named update_body_patch, similar to the json merge patch. While this will restrict the use of expression parameters, in that there is no trivial way to convert them into types other than string.
Also, note that any change to this attribute won't cause a real update, unless the body has changes.
Lastly, the name of update_body_patches is picked for the potential attributes ephemeral_body_patches (or write_only_body_patches), for both create and update.
This PR adds support for
update_body_patches
to therestful_resource
resource. This attribute is not supposed to be used for most API providers. The only use case can be found at https://github.com/magodo/terraform-provider-restful/issues/125, where the API requires the resource ID for an update, which is only available after the creation.The reason this schema is designed as such, especially using the
raw_json
here is to support different data types. Note that the dynamic type can't be used here, see https://github.com/hashicorp/terraform-plugin-framework/issues/973.Another attempt is to turn the patches into one single dynamic attribute named
update_body_patch
, similar to the json merge patch. While this will restrict the use of expression parameters, in that there is no trivial way to convert them into types other than string.Also, note that any change to this attribute won't cause a real update, unless the
body
has changes.Lastly, the name of
update_body_patches
is picked for the potential attributesephemeral_body_patches
(orwrite_only_body_patches
), for both create and update.Fix https://github.com/magodo/terraform-provider-restful/issues/125.