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
Structured success output is rolling out command by command. Currently migrated commands are `version`, `account`, `du`, `ls`, `search`, `revs`, `cp`, `mv`, `put`, `get`, `share-link create`, `share-link list`, `share-link info`, `share-link update`, `share-link revoke`, `share-link download`, `share list folder`, `team info`, `team list-members`, `team list-groups`, `team add-member`, `team remove-member`, `mkdir`, `rm`, and `restore`. Commands that have not been migrated return a JSON error whose `error.message` is `structured output is not supported for this command yet` when used with `--output=json`.
168
+
Structured success output is rolling out command by command. Currently migrated commands are `version`, `account`, `du`, `ls`, `search`, `revs`, `cp`, `mv`, `put`, `get`, `share-link create`, `share-link list`, `share-link info`, `share-link update`, `share-link revoke`, `share-link download`, `share list folder`, `share list link`, `team info`, `team list-members`, `team list-groups`, `team add-member`, `team remove-member`, `mkdir`, `rm`, and `restore`. Commands that have not been migrated return a JSON error whose `error.message` is `structured output is not supported for this command yet` when used with `--output=json`.
169
169
170
170
Command results and JSON errors are written to stdout. Status, progress, human-facing warnings, diagnostics, and verbose logs are written to stderr. JSON errors include a `warnings` array for machine-actionable warnings; it is `[]` when no warnings are present. Successful JSON payloads use the same `warnings` field.
171
171
Current warning codes include `deprecated_command` for deprecated command paths and `skipped_symlink` for symlinks skipped by recursive upload.
172
172
173
+
Commands that intentionally do not support JSON output yet include `login`, `logout`, and `completion`. Cobra help output and shell-completion protocol commands are also text-only.
174
+
175
+
JSON error responses use stable `error.code` values:
|`invalid_arguments`| The command arguments or flags are invalid. |
180
+
|`path_conflict`| A local or Dropbox path conflicts with the requested operation. |
181
+
|`auth_required`| No usable saved credentials were found, or Dropbox rejected the saved token. |
182
+
|`auth_refresh_failed`| Saved refreshable credentials could not be refreshed. |
183
+
|`app_key_required`| Login or token refresh needs a Dropbox app key. |
184
+
|`auth_exchange_failed`| The OAuth authorization-code exchange failed or returned unusable tokens. |
185
+
|`not_found`| Dropbox reported that the requested object was not found. |
186
+
|`permission_denied`| Dropbox denied access because of permissions, scope, member selection, or state. |
187
+
|`rate_limited`| Dropbox rate limited the request. |
188
+
|`dropbox_api_error`| Dropbox returned an API error that does not map to a more specific code yet. |
189
+
|`structured_output_unsupported`| The command does not support `--output=json` yet. |
190
+
|`unsupported_output_format`|`--output` was not `text` or `json`. |
191
+
|`unknown_command`| Cobra could not resolve the command. |
192
+
|`unknown_flag`| Cobra could not resolve a flag. |
193
+
|`command_failed`| Fallback for failures without a more specific stable code. |
194
+
173
195
Successful JSON responses for migrated commands return an `input` object, a `results` array, and a `warnings` array. Result payloads are command-specific. For commands such as `mkdir`, each result reports what happened to the requested path:
174
196
175
197
```json
@@ -466,7 +488,7 @@ In JSON mode, command errors are written to stdout as JSON, including errors fro
466
488
}
467
489
```
468
490
469
-
Error `code` values are stable identifiers intended for scripts. Current codes are `structured_output_unsupported`, `unsupported_output_format`, `unknown_command`, `unknown_flag`, `path_conflict`, `invalid_arguments`, and `command_failed`.
491
+
Error `code` values are stable identifiers intended for scripts. The current stable codes are listed in the table above.
0 commit comments