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 DSBooljson:"locked,omitempty"`` resolves the problem.
Using v2.1 of the esign library, the "omitempty" portion of
Locked DSBool `json:"locked,omitempty"`
at https://github.com/jfcote87/esign/blob/5064b2fe6847296edf1df5b4dc4cb68150775257/v2.1/model/model.go#L13620 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
andmodel.Text.Locked
is not set in the request,model.Text.Locked
defaults totrue
in 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.Value
andmodel.Text.Locked = false
to allow a signer to edit a text tab (since the json form ofmodel.Text.Locked = false
is excluded from the request due to "omitempty"). Removing "omitempty" fromLocked DSBool
json:"locked,omitempty"`` resolves the problem.From Go docs https://pkg.go.dev/encoding/json: