Skip to content

Conversation

@zoo-github-actions-auth
Copy link
Contributor

Updating the spec from that in the api repo

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.55%. Comparing base (e09a083) to head (2af3b09).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1407      +/-   ##
==========================================
- Coverage   70.56%   70.55%   -0.02%     
==========================================
  Files          41       40       -1     
  Lines        6622     6619       -3     
==========================================
- Hits         4673     4670       -3     
  Misses       1949     1949              
Flag Coverage Δ
unittests 70.55% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 41639 to 43327
@@ -42797,6 +43055,99 @@
}
]
},
"SubscriptionPlanBillingModel": {
"description": "Billing model for a modeling-app plan price.",
"oneOf": [
{
"description": "A flat amount charged every interval.",
"type": "string",
"enum": [
"flat"
]
},
{
"description": "A per-seat amount charged every interval.",
"type": "string",
"enum": [
"per_user"
]
}
]
},
"SubscriptionPlanPriceRecord": {
"description": "Diesel model representing a row in `subscription_plan_prices`.",
"type": "object",
"properties": {
"active": {
"description": "Whether this price is currently active.",
"type": "boolean"
},
"billing_model": {
"description": "Billing model persisted in the database (`flat`, `per_user`, or `enterprise`).",
"allOf": [
{
"$ref": "#/components/schemas/SubscriptionPlanBillingModel"
}
]
},
"cadence": {
"description": "Billing cadence string (for example `month` or `year`).",
"allOf": [
{
"$ref": "#/components/schemas/PlanInterval"
}
]
},
"created_at": {
"title": "DateTime",
"description": "Timestamp when the price row was created.",
"type": "string",
"format": "date-time"
},
"id": {
"description": "Unique identifier for the plan price entry.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"stripe_price_id": {
"nullable": true,
"description": "Stripe price identifier, when synchronized.",
"type": "string"
},
"subscription_plan_id": {
"description": "Foreign key referencing the parent plan.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"unit_amount": {
"nullable": true,
"description": "Optional monetary amount associated with the price row.",
"type": "string",
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type mismatch between request and response schemas for unit_amount. In PriceUpsertRequest (line 41639-41643), unit_amount is defined as a required number with format double. However, in SubscriptionPlanPriceRecord (line 43128-43133), the same field is returned as a nullable string with a regex pattern. This will cause type errors in client code.

Impact: Clients sending POST requests to /subscription-plans/{slug}/prices will send a number but receive a string back, breaking type safety and potentially causing parsing errors.

Fix:

// Make both schemas consistent - either both number or both string
// Option 1: Make response also a number
"unit_amount": {
  "nullable": true,
  "description": "Optional monetary amount associated with the price row.",
  "type": "number",
  "format": "double"
}

// Option 2: Make request also a string
"unit_amount": {
  "description": "Amount in USD.",
  "type": "string",
  "pattern": "^-?[0-9]+(\\.[0-9]+)?$"
}
Suggested change
"unit_amount": {
"description": "Amount in USD.",
"type": "number",
"format": "double"
}
},
"required": [
"billing_model",
"cadence",
"unit_amount"
]
},
"PrivacySettings": {
"description": "Privacy settings for an org or user.",
"type": "object",
}
]
},
"SubscriptionPlanBillingModel": {
"description": "Billing model for a modeling-app plan price.",
"oneOf": [
{
"description": "A flat amount charged every interval.",
"type": "string",
"enum": [
"flat"
]
},
{
"description": "A per-seat amount charged every interval.",
"type": "string",
"enum": [
"per_user"
]
}
]
},
"SubscriptionPlanPriceRecord": {
"description": "Diesel model representing a row in `subscription_plan_prices`.",
"type": "object",
"properties": {
"active": {
"description": "Whether this price is currently active.",
"type": "boolean"
},
"billing_model": {
"description": "Billing model persisted in the database (`flat`, `per_user`, or `enterprise`).",
"allOf": [
{
"$ref": "#/components/schemas/SubscriptionPlanBillingModel"
}
]
},
"cadence": {
"description": "Billing cadence string (for example `month` or `year`).",
"allOf": [
{
"$ref": "#/components/schemas/PlanInterval"
}
]
},
"created_at": {
"title": "DateTime",
"description": "Timestamp when the price row was created.",
"type": "string",
"format": "date-time"
},
"id": {
"description": "Unique identifier for the plan price entry.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"stripe_price_id": {
"nullable": true,
"description": "Stripe price identifier, when synchronized.",
"type": "string"
},
"subscription_plan_id": {
"description": "Foreign key referencing the parent plan.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"unit_amount": {
"nullable": true,
"description": "Optional monetary amount associated with the price row.",
"type": "number",
"format": "double"
},

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@jessfraz jessfraz merged commit d42edd2 into main Jan 3, 2026
16 of 17 checks passed
@jessfraz jessfraz deleted the update-spec branch January 3, 2026 21:21
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