Skip to content

fix(api-docs): correct integer field types in event-type schema#28042

Open
vivektarun wants to merge 1 commit intocalcom:mainfrom
vivektarun:fix/api-v2-docs-integer-fields
Open

fix(api-docs): correct integer field types in event-type schema#28042
vivektarun wants to merge 1 commit intocalcom:mainfrom
vivektarun:fix/api-v2-docs-integer-fields

Conversation

@vivektarun
Copy link

@vivektarun vivektarun commented Feb 18, 2026

What does this PR do?

Fixes incorrect data types in the API V2 documentation schema that caused the interactive "Try it" console for POST /v2/event-types to send integer fields as strings, resulting in validation errors from the API.

Motivation & Context

The OpenAPI schema defined numeric fields as string, which caused Swagger UI to serialize numeric inputs like:

"lengthInMinutes": 60 - But the data type is number

The API correctly validates these as integers and rejected requests with:

lengthInMinutes must be an integer number

This PR updates the schema definitions so these fields are correctly typed as integers, ensuring the documentation console sends valid JSON numbers.

Changes

  • Updated OpenAPI schema types:
    • lengthInMinutes → integer
    • lengthInMinutesOptions[] → integer
  • Verified interactive docs now send numeric values instead of quoted strings
  • Confirmed API accepts requests successfully

Visual Demo

Image Demo

Before Fix:
Bug

Try-it console sends:
"lengthInMinutes": "60"

API Response:
Validation error → must be integer

After Fix:
bug-fixed

Try-it console sends:
"lengthInMinutes": 60

API Response:
Success response ✔


Mandatory Tasks

  • I have self-reviewed the code
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Run the project locally
  2. Open API V2 documentation
  3. Navigate to endpoint:
    POST /v2/event-types
  4. Enter required values:
    title = Test Event
    slug = test-event
    length = 60
  5. Click Run Request

Expected Result

Payload should now send:

lengthInMinutes: 60 as integer

instead of

"lengthInMinutes": 60 number

The API should return a success response instead of a validation error.


Environment Variables

No additional environment variables required beyond standard local setup.


Minimal Test Data

Only required fields:

  • title
  • slug
  • length

Checklist

  • My code follows project style guidelines
  • I have commented code where necessary
  • My changes generate no new warnings
  • My PR is small and focused

@github-actions github-actions bot added the 🐛 bug Something isn't working label Feb 18, 2026
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 18, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation "Try it" console send Integers as strings causing validation error

1 participant

Comments