Using v2.1 of the esign library, the "omitempty" portion of Locked DSBool `json:"locked,omitempty"` at
|
Locked DSBool `json:"locked,omitempty"` |
is problematic and results in undesired behavior.
Per the docs https://pkg.go.dev/encoding/json, "The 'omitempty' option specifies that the field should be omitted from encoding if the field has an empty value, defined as false, ..."
Using v2.1 of the library, the problem arises when setting TabValue.Value in model.Text
when creating an editable text tab (model.Text) for a signer and setting a non-empty string value (TabValue.Value).
I cannot find this explicitly stated in DocuSign docs, but based off the API behavior, when the json values for a request to Docusign contains a non-empty string for model.Text.TabValue.Value and model.Text.Locked is not set in the request, model.Text.Locked defaults to true in DocuSign's end of the API. Essentially, the 'omitempty' part of Locked DSBool `json:"locked,omitempty"` prevents one from setting a non-empty string value for model.Text.TabValue.Value and model.Text.Locked = false to allow a signer to edit a text tab (since the json form of model.Text.Locked = false is excluded from the request due to "omitempty"). Removing "omitempty" from Locked DSBool json:"locked,omitempty"`` resolves the problem.
From Go docs https://pkg.go.dev/encoding/json:

Using v2.1 of the esign library, the "omitempty" portion of
Locked DSBool `json:"locked,omitempty"`atesign/v2.1/model/model.go
Line 13620 in 5064b2f
Per the docs https://pkg.go.dev/encoding/json, "The 'omitempty' option specifies that the field should be omitted from encoding if the field has an empty value, defined as false, ..."
Using v2.1 of the library, the problem arises when setting TabValue.Value in model.Text
when creating an editable text tab (model.Text) for a signer and setting a non-empty string value (TabValue.Value).
I cannot find this explicitly stated in DocuSign docs, but based off the API behavior, when the json values for a request to Docusign contains a non-empty string for
model.Text.TabValue.Valueandmodel.Text.Lockedis not set in the request,model.Text.Lockeddefaults totruein DocuSign's end of the API. Essentially, the 'omitempty' part ofLocked DSBool `json:"locked,omitempty"`prevents one from setting a non-empty string value formodel.Text.TabValue.Valueandmodel.Text.Locked = falseto allow a signer to edit a text tab (since the json form ofmodel.Text.Locked = falseis excluded from the request due to "omitempty"). Removing "omitempty" fromLocked DSBooljson:"locked,omitempty"`` resolves the problem.From Go docs https://pkg.go.dev/encoding/json:
