You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect the expires field to be missing or possibly empty string
Actual Behavior
There may be a special case for this in the dropbox API, but expires is not supported by a non enterprise dropbox, so if you supply anything in the expires you get
Because time.Time is struct, its empty value is all the fields empty, hence the "0001-01-01T00:00:00Z".
A patch like this does fix the problem - making the time.Time into a pointer type so it can be omitted properly.
diff --git a/dropbox/sharing/types.go b/dropbox/sharing/types.go
index 085cda4..6ab9870 100644
--- a/dropbox/sharing/types.go+++ b/dropbox/sharing/types.go@@ -3922,7 +3922,7 @@ type SharedLinkSettings struct {
LinkPassword string `json:"link_password,omitempty"`
// Expires : Expiration time of the shared link. By default the link won't
// expire.
- Expires time.Time `json:"expires,omitempty"`+ Expires *time.Time `json:"expires,omitempty"`
// Audience : The new audience who can benefit from the access level
// specified by the link's access level specified in the `link_access_level`
// field of `LinkPermissions`. This is used in conjunction with team
However that needs to be done in the generator. It is also not backwards compatible.
An alternate patch would be to make a special case MarshalJSON for the Expires which checked expires = time.Time{} and omitted it.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'd like to create a sharing link with supplying
sharing.SharedLinkSettings
but without supplyingsharing.SharedLinkSettings.Expires
To Reproduce
Submit a request like this
The actual JSON submitted to the endpoint is this (formatted for readability)
Note the
"expires": "0001-01-01T00:00:00Z"
Expected Behavior
I would expect the
expires
field to be missing or possibly empty stringActual Behavior
There may be a special case for this in the dropbox API, but expires is not supported by a non enterprise dropbox, so if you supply anything in the
expires
you getVersions
This reproduces with the SDK at master
Additional context
Because
time.Time
is struct, its empty value is all the fields empty, hence the"0001-01-01T00:00:00Z"
.A patch like this does fix the problem - making the
time.Time
into a pointer type so it can be omitted properly.However that needs to be done in the generator. It is also not backwards compatible.
An alternate patch would be to make a special case MarshalJSON for the Expires which checked
expires = time.Time{}
and omitted it.The text was updated successfully, but these errors were encountered: