Skip to content

Conversation

@jcscottiii
Copy link
Collaborator

No description provided.

jcscottiii added a commit that referenced this pull request Nov 21, 2025
This commit introduces two main changes to improve the robustness of the user subscription feature and prepare for future API expansion.

**Forward-Compatible Subscription Triggers**

To prevent errors when a subscription trigger is deprecated or removed, the data model has been refactored to be forward-compatible.

- The OpenAPI specification now uses a `SubscriptionTriggerResponseItem` schema. This object returns the trigger's `value` and an optional `raw_value`.
- If a trigger stored in the database is no longer a valid API enum, its `value` is now set to 'unknown', and the original database string is preserved in `raw_value`. This ensures the API does not fail when encountering old data.
- The backend adapter and its tests have been updated to handle this new structure.

**API Endpoint Placeholders**

As part of the effort to split up a large pull request (#2041), this commit adds placeholder paths to `openapi.yaml` for future subscription management endpoints. These paths are for planning purposes and do not have functional implementations in this change:
- `/v1/users/me/subscriptions`
- `/v1/users/me/subscriptions/{subscription_id}`

**Other Changes**
- A specific error for unauthorized subscription creation attempts has been added.
github-merge-queue bot pushed a commit that referenced this pull request Nov 22, 2025
This commit introduces two main changes to improve the robustness of the user subscription feature and prepare for future API expansion.

**Forward-Compatible Subscription Triggers**

To prevent errors when a subscription trigger is deprecated or removed, the data model has been refactored to be forward-compatible.

- The OpenAPI specification now uses a `SubscriptionTriggerResponseItem` schema. This object returns the trigger's `value` and an optional `raw_value`.
- If a trigger stored in the database is no longer a valid API enum, its `value` is now set to 'unknown', and the original database string is preserved in `raw_value`. This ensures the API does not fail when encountering old data.
- The backend adapter and its tests have been updated to handle this new structure.

**API Endpoint Placeholders**

As part of the effort to split up a large pull request (#2041), this commit adds placeholder paths to `openapi.yaml` for future subscription management endpoints. These paths are for planning purposes and do not have functional implementations in this change:
- `/v1/users/me/subscriptions`
- `/v1/users/me/subscriptions/{subscription_id}`

**Other Changes**
- A specific error for unauthorized subscription creation attempts has been added.
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