aptly icon indicating copy to clipboard operation
aptly copied to clipboard

API does not allow description field to be cleared

Open charles-dyfis-net opened this issue 4 years ago • 0 comments

If a snapshot has been created with a nonempty description, this description cannot be set to the empty string via the API.

Context

I'm using description fields to implement a multi-stage commit operation for creating multiple snapshots together (and being able to roll this operation back should a failure take place before all the requested snapshots are created) by using the description field to store sigil values that indicate transaction status.

Right now, if implementing logic of this kind, I need to define a nonempty string to set as the description for snapshots when the transaction is complete.

Possible Implementation

One way to do this would be to make the description field a pointer to a string rather than a string itself, to make nil and "" distinguishable.

charles-dyfis-net avatar Mar 25 '21 00:03 charles-dyfis-net