Skip to content

Conversation

@jcscottiii
Copy link
Collaborator

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.

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.
@jcscottiii jcscottiii requested a review from jrobbins November 21, 2025 23:07
@jcscottiii jcscottiii added this pull request to the merge queue Nov 22, 2025
Merged via the queue into main with commit d986260 Nov 22, 2025
7 checks passed
@jcscottiii jcscottiii deleted the jcscottiii/openapi-november-placeholders branch November 22, 2025 03:25
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.

2 participants