Skip to content

Migrate Users API to v2#1

Closed
infracore wants to merge 1 commit into
mainfrom
feature/v2-migration
Closed

Migrate Users API to v2#1
infracore wants to merge 1 commit into
mainfrom
feature/v2-migration

Conversation

@infracore

Copy link
Copy Markdown
Member

Summary

Migrating the Users API from v1 to v2 with multi-tenant support.

Breaking Changes

  • Add required tenant_id header to GET /users
  • Change userId path parameter from string to integer
  • Remove DELETE /users/{userId} (replaced with soft delete via PATCH)
  • Change User.id from string to integer
  • Remove editor from role enum (consolidated into admin)
  • Add required tenant_id field to User schema

New

  • GET /v2/users endpoint

Delimit will automatically detect these breaking changes and post a migration guide below.

- Add required tenant_id header to GET /users
- Change userId type from string to integer
- Remove DELETE /users/{userId} (use soft delete)
- Change User.id from string to integer
- Rename User.name to User.display_name
- Remove 'editor' from role enum
- Add required tenant_id to User schema
- Add new /v2/users endpoint
@github-actions

Copy link
Copy Markdown

🔴 MAJOR — Breaking Changes Detected

7 changes · 6 breaking · 1 additive · next: 2.0.0

Breaking Changes

Change Location Severity
Cannot add required parameter tenant_id to /users:GET /users:GET 🟠 High
Method DELETE cannot be removed from /users/{userId} /users/{userId}:DELETE 🔴 Critical
Type changed from string to integer at /users/{userId}:GET /users/{userId}:GET 🟡 Warning
Type changed from string to integer at #/components/schemas/User.id #/components/schemas/User.id 🟡 Warning
📋 Migration guide

Migration Guide: Users API (1.0.0 -> 2.0.0)

This release contains 6 breaking change(s).
Follow the steps below to update your integration.

Step 1: Required Param Added

Change: Required parameter added: tenant_id to /users:GET
Location: /users:GET

Action: All existing requests must now include this parameter. Update every call site to pass the new required value.

Step 2: Method Removed

Change: Method removed: DELETE /users/{userId}
Location: /users/{userId}:DELETE

Action: Update clients using this HTTP method. Check if an alternative method is available on the same path.

Step 3: Type Changed

Change: Parameter type changed: userId from string to integer
Location: /users/{userId}:GET

Action: Update serialization/deserialization logic for the new type. Check all type assertions, validators, and database column types.

Step 4: Required Field Added

Change: New required field 'tenant_id' added at #/components/schemas/User
Location: #/components/schemas/User.tenant_id

Action: If this is a request body field, include it in all requests. If this is a response field, update parsers to handle the new field.

Step 5: Enum Value Removed

Change: Enum value 'editor' removed at #/components/schemas/User.role
Location: #/components/schemas/User.role

Action: Stop sending the removed enum value. Update any switch/case or if/else blocks that handle it.

Step 6: Type Changed

Change: Type changed from string to integer at #/components/schemas/User.id
Location: #/components/schemas/User.id

Action: Update serialization/deserialization logic for the new type. Check all type assertions, validators, and database column types.


After completing all steps, run your integration tests to verify.

✅ New additions (1)
  • /v2/users — New endpoint added: /v2/users

Delimit · API governance for CI/CD

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