Skip to content

Add Dropbox API error classification and contract audits#288

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
json-api-error-codes
Jun 25, 2026
Merged

Add Dropbox API error classification and contract audits#288
AndreyVMarkelov merged 1 commit into
masterfrom
json-api-error-codes

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Classify Dropbox SDK errors into stable JSON error codes (auth_required, not_found, permission_denied, rate_limited, dropbox_api_error, path_conflict) via typed error matching, reflection-based summary extraction, and message parsing
  • Add coded error factories for auth flows (auth_required, app_key_required, auth_exchange_failed, auth_refresh_failed) and wire them into all auth error paths
  • Introduce golden contract tests: schema audit validates definitions and per-command schemas against a fixture, success output audit validates representative example payloads, and fixture coverage audit ensures every structured command has test coverage
  • Document all JSON error codes in README table

Test plan

  • All existing tests pass
  • New TestJSONErrorCodeClassifiesDropboxAPIErrors covers typed SDK errors, wrapped errors, and string-format errors
  • TestJSONErrorCodeDoesNotClassifyPlainValidationStrings prevents false positives
  • Auth tests assert correct error codes on all failure paths
  • TestStructuredOutputGoldenSchemaAudit validates schema fixture against code-derived schemas
  • TestStructuredOutputGoldenSuccessOutputAudit validates golden JSON examples match code
  • TestStructuredOutputSuccessFixtureAudit verifies test function references exist
  • gofmt, go vet, golangci-lint all pass

Introduce typed error codes for auth failures (auth_required, app_key_required, auth_exchange_failed, auth_refresh_failed) and Dropbox API errors (not_found, path_conflict, permission_denied, rate_limited, dropbox_api_error). Classify SDK errors via typed matching and Dropbox summary extraction.

Expand JSON contract coverage with golden schema checks, success-test coverage tracking, and golden success-output fixtures for all structured-output commands so wrappers, fields, statuses, kinds, warnings, and representative payloads stay stable.
@AndreyVMarkelov AndreyVMarkelov merged commit df0841b into master Jun 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant