Open amvapor opened 1 year ago
This is exactly the solution I'm looking for. It has great potential for many scenarios. Why not being merged ?
I'm also having the exact same issue. Though maybe arbitrary searching for "{id}" is not the best approach, as it can easily lead to false positives. Maybe we need to add a "update_with_object_id = true" parameter?
Actually just discovered that copy_keys provides functionality for exactly this purpose!
Actually just discovered that copy_keys provides functionality for exactly this purpose!
Hi @ivank, can you provide me/us with an example. I am trying to the variable as above, but the body still shows the variable name and not the actual id.
Small detail: we get the id not in the root, but in a object called data and we need to add this to the update and delete body.
Thanks
Built to fix: https://github.com/Mastercard/terraform-provider-restapi/issues/230
The API I am interacting with has a
/services
endpoint, where updates require an ID in the payload, so with this change, we can inject the id using the keyword{id}
. In my case, I inject the id into payload and can make aPOST
to/services
with the id in the body, which meets the criteria of the API in question to update the resource rather than creating another one.Way I am utilizing in my code: