Skip to content

feat(google): Calendar discovery document endpoint#55

Open
yonatangross wants to merge 3 commits intovercel-labs:mainfrom
yonatangross:feat/google-calendar-discovery
Open

feat(google): Calendar discovery document endpoint#55
yonatangross wants to merge 3 commits intovercel-labs:mainfrom
yonatangross:feat/google-calendar-discovery

Conversation

@yonatangross
Copy link
Copy Markdown

Summary

  • Add GET /discovery/v1/apis/calendar/v3/rest endpoint to the Google emulator
  • Returns a minimal Google API Discovery Document describing implemented Calendar routes
  • Enables google-api-python-client build("calendar", "v3") and similar SDK bootstrapping against the emulator
  • No auth required (matches real Google API behavior)

Changes

File Change
routes/calendar.ts Add discovery endpoint with calendarList, events, freebusy resources (+85 LOC)
google.test.ts Test: status 200, correct schema fields, all implemented methods described (+33 LOC)

How it works

The endpoint returns a static JSON document following the Google Discovery format:

{
  "kind": "discovery#restDescription",
  "name": "calendar",
  "version": "v3",
  "rootUrl": "http://localhost:4005/",
  "servicePath": "calendar/v3/",
  "resources": {
    "calendarList": { "methods": { "list": {...} } },
    "events": { "methods": { "list": {...}, "insert": {...}, "delete": {...} } },
    "freebusy": { "methods": { "query": {...} } }
  }
}

rootUrl is dynamic — it reflects the server's actual origin so SDK clients connect to the right host.

Test plan

  • GET /discovery/v1/apis/calendar/v3/rest returns 200
  • Response has correct kind, name, version, id fields
  • rootUrl reflects server origin
  • All implemented resources described: calendarList.list, events.list/insert/delete, freebusy.query
  • No auth required to access discovery endpoint
  • Full monorepo test suite passes (383 tests, 0 failures)
  • Lint + type-check clean

🤖 Generated with Claude Code

Add GET /discovery/v1/apis/calendar/v3/rest serving a minimal discovery
document that describes the Calendar routes this emulator implements:
calendarList.list, events.list, events.insert, events.delete, and
freebusy.query.

This enables google-api-python-client build("calendar", "v3") and
similar SDK bootstrapping to work against the emulator without hitting
the real Google API.

- No auth required (matches real Google behavior)
- rootUrl dynamically reflects the server origin
- 2 files changed, +117 lines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 8, 2026

@yonatangross is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 122108ea80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

yonatangross and others added 2 commits April 8, 2026 15:16
Address Codex review feedback on PR vercel-labs#55:

- Add baseUrl and basePath to discovery doc (required by Python/JS SDKs)
- Add singleEvents and showDeleted to events.list parameters
- Match real Google title ("Calendar API") and description
- Add events.list query params: timeMin, timeMax, maxResults,
  pageToken, q, orderBy (P2 review feedback)
- Update README.md with discovery endpoint listing (P1 review feedback)
- Add baseUrl/basePath assertions to test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused `escapeAttr` import
- Prefix unused `redirect_uri` with underscore (token endpoint parses
  it but doesn't validate it against the auth request — separate issue)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yonatangross yonatangross force-pushed the feat/google-calendar-discovery branch from 9f86639 to 7515255 Compare April 8, 2026 12:19
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