Skip to content

Fix API spec to match actual response types#6

Closed
acallaghan wants to merge 4 commits intomainfrom
claude/init-staff-admin-app-oqTVf
Closed

Fix API spec to match actual response types#6
acallaghan wants to merge 4 commits intomainfrom
claude/init-staff-admin-app-oqTVf

Conversation

@acallaghan
Copy link
Copy Markdown
Contributor

@acallaghan acallaghan commented Mar 27, 2026

Summary

Discovered while building the ePOS staff app against the staging API (demo.jammed.dev) that several schema definitions in v2/jammed.yaml don't match the actual API responses.

  • room.id: Changed from string to integer. The API returns numeric IDs (e.g. 1, 2, 3), not string codes
  • customer.regular_bookings_count: Can return boolean false instead of integer 0 when the customer has no regular bookings. Updated to oneOf [integer, boolean]
  • short_group: Added number field (nullable integer, used in customer band responses) and booking_count field. The existing number_of_members is retained for full group responses

Test plan

  • Verify GET /dashboard response rooms[].id is integer in staging
  • Verify GET /customers.json with a customer who has 0 regular bookings returns false for regular_bookings_count
  • Verify GET /customers.json band objects include number and booking_count fields

https://claude.ai/code/session_01AUVAYoQ6vtiGeSvWiGsfpK


Note

Low Risk
Low risk because changes are documentation/schema-only, but they can break generated clients by changing types (e.g. room.id to integer and widening unions).

Overview
Updates v2/jammed.yaml to better match real API responses seen in staging.

Adjusts model typing by making room.id an integer (not string), allowing customer.regular_bookings_count to be integer or boolean (to reflect false for none), and expanding short_group with nullable number plus booking_count while keeping number_of_members for full group responses.

Written by Cursor Bugbot for commit cf62f31. This will update automatically on new commits. Configure here.

claude and others added 2 commits March 27, 2026 19:06
Discovered while building the ePOS staff app against the staging API
that several schema definitions don't match the real responses:

- room.id: Changed from string to integer. The API returns numeric
  IDs (e.g. 1, 2, 3), not string codes.
- customer.regular_bookings_count: Can return boolean `false` instead
  of integer `0` when the customer has no regular bookings. Updated
  to oneOf [integer, boolean].
- short_group: Added `number` field (nullable integer, used in
  customer band responses) and `booking_count` field. The existing
  `number_of_members` is retained for full group responses.

https://claude.ai/code/session_01AUVAYoQ6vtiGeSvWiGsfpK
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 27, 2026

Deploying api with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2fe6293
Status: ✅  Deploy successful!
Preview URL: https://47b4de67.api-dwa.pages.dev
Branch Preview URL: https://claude-init-staff-admin-app.api-dwa.pages.dev

View logs

claude and others added 2 commits March 27, 2026 19:53
The dashboard endpoint returns bookings in a completely different
format than was documented:

Removed (not present in real response):
- start_at, end_at (unix timestamps)
- start_time, end_time (time strings)
- room (object with id/name/code)
- customer (object with id/name/email)
- cancelled (boolean)

Added (present in real response):
- start, end: datetime strings "YYYY-MM-DD HH:mm"
- split: room code string (matches rooms[].code)
- room_name: room display name
- amount_due: formatted currency string e.g. "£1.00" (was integer)
- payments_recieved: boolean (note API spelling)
- show_studio_notes: boolean
- extras_summary: changed from string to array of strings
- link: admin path string
- type: "booking" or "blocked"
- class: CSS class string

https://claude.ai/code/session_01AUVAYoQ6vtiGeSvWiGsfpK
acallaghan pushed a commit that referenced this pull request Mar 29, 2026
Replays schema fixes from PR #6 cleanly onto main, avoiding merge
conflicts caused by intervening Postman collection and studio.json changes.

- room.id: string → integer (API returns numeric IDs)
- customer.regular_bookings_count: allow boolean false in addition to integer
- short_group: add number (nullable) and booking_count fields
- dashboard_booking: rewrite to match actual dashboard response format
  (start/end datetimes, split room code, formatted amount_due, etc.)

https://claude.ai/code/session_01DgxWeWcLq3ao4NDvAUQTzX
@acallaghan acallaghan closed this Mar 29, 2026
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