Skip to content

Adapt clients for new storage API and enhance error handling#45

Merged
leefaus merged 1 commit into
releasefrom
dev
May 6, 2026
Merged

Adapt clients for new storage API and enhance error handling#45
leefaus merged 1 commit into
releasefrom
dev

Conversation

@leefaus
Copy link
Copy Markdown
Contributor

@leefaus leefaus commented May 5, 2026

This pull request makes several improvements and breaking changes to how organizations and teams are handled, focusing on org-scoped base URLs/subdomains, API request/response consistency, and error handling. The most important changes include switching team and team member routes to be org-scoped via the client’s base URL, updating serialization to use snake_case for project requests, improving error parsing, and adding slug handling for organizations.

Organization and Team Routing (org-scoped base URLs)

  • All team and team member API routes now depend on the client’s base URL/subdomain for organization scoping, rather than including the org slug in the path. This means identical team slugs in different orgs are distinguished by their base URL, and all team-related endpoints were updated accordingly. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Added and updated tests to verify that identical team slugs are distinguished by the client’s base URL, and that path construction matches the new routing logic. [1] [2]

Organization Creation and Slug Handling

  • Organization creation now generates and sends a slug derived from the organization name, with a new slugify function to ensure consistent slugs. The CreateOrgRequest struct and related tests were updated to require and verify the slug field. [1] [2] [3]

API Request/Response Consistency

  • Changed serialization for CreateProjectRequest and UpdateProjectRequest to use snake_case instead of camelCase, and updated tests to match. [1] [2] [3] [4]
  • Added serde aliases to struct fields in ResponseMetadata, WorkspaceInfo, and ProjectInfo to support both camelCase and snake_case field names in API responses, improving compatibility. [1] [2] [3]

Error Handling Improvements

  • Improved error parsing in StorageClient to handle both ApiResponse and direct ApiError bodies, with a new status_error helper for consistent error mapping.

Miscellaneous

  • On identity registration, the CLI now updates and saves the global config with the server URL and default org slug. [1] [2]
  • Updated tests to check for snake_case field names in JSON serialization for team members and org members. [1] [2]

These changes are breaking for any consumer relying on the previous team and team member path structure or camelCase project request fields. Be sure to update clients and integrations accordingly.Persist server URL and default_org in GlobalConfig during identity registration
Parse direct ApiError bodies and centralize HTTP status → RemoteError mapping
Add serde aliases for renamed fields and switch teams endpoints to org-scoped
paths. Generate org slugs client-side (slugify) and update tests for visibility and
field name casing

Persist server URL and default_org in GlobalConfig during identity
registration
Parse direct ApiError bodies and centralize HTTP status → RemoteError
mapping
Add serde aliases for renamed fields and switch teams endpoints to
org-scoped
paths. Generate org slugs client-side (slugify) and update tests for
visibility and
field name casing
@leefaus leefaus merged commit cf07fdb into release May 6, 2026
7 checks passed
@leefaus leefaus deleted the dev branch May 6, 2026 02:19
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