Skip to content

feat(web): OpenAPI full fetch client (PLAN §4.2)#16

Merged
mcalthrop merged 3 commits into
mainfrom
feat/web-openapi-full-client
Apr 3, 2026
Merged

feat(web): OpenAPI full fetch client (PLAN §4.2)#16
mcalthrop merged 3 commits into
mainfrom
feat/web-openapi-full-client

Conversation

@mcalthrop
Copy link
Copy Markdown
Owner

Summary

Completes PLAN §4.2: generate a full fetch-based SDK from packages/openapi/openapi.yaml using @hey-api/openapi-ts, with hand-written apiClient + wrappers in apps/web/src/api/, and Redocly lint wired for pnpm openapi:validate.

Details

  • Generated output: apps/web/src/api/generated/ (committed; regenerate via pnpm --filter web openapi:generate).
  • Runtime: VITE_API_BASE_URL optional; dev defaults to http://127.0.0.1:8000; production build uses same-origin when unset (see apps/web/.env.example).
  • Validate: apps/web openapi:validate delegates to pnpm --filter @solid-pact/openapi run lint (redocly lint).

Checklist

  • pnpm --filter web lint
  • pnpm --filter web test
  • pnpm --filter web build
  • pnpm --filter web openapi:validate

Made with Cursor

- Add @hey-api/openapi-ts with openapi-ts.config.ts; commit generated SDK under src/api/generated.
- Hand-written apiClient and wrappers in src/api (base URL from VITE_API_BASE_URL / dev default).
- Biome excludes generated output; document .env.example and OpenAPI scripts in apps/web README.
- Wire openapi:validate to pnpm --filter @solid-pact/openapi run lint.
- Mark PLAN §4.2 complete.

Made-with: Cursor
Copilot AI review requested due to automatic review settings April 3, 2026 10:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a generated fetch-based OpenAPI SDK to the SolidJS web app (PLAN §4.2), along with a small hand-written client/wrapper layer and OpenAPI validation wiring.

Changes:

  • Generate and commit a full SDK under apps/web/src/api/generated/ via @hey-api/openapi-ts.
  • Add apiClient with VITE_API_BASE_URL/dev-default base URL resolution plus wrapper exports in apps/web/src/api/.
  • Wire scripts/docs/config for generation + Redocly lint (openapi:generate, openapi:validate) and exclude generated code from Biome.

Reviewed changes

Copilot reviewed 9 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Adds @hey-api/openapi-ts and related transitive dependencies.
PLAN.md Marks PLAN §4.2 as complete.
apps/web/tsconfig.node.json Includes openapi-ts.config.ts in node TS config for tooling/typechecking.
apps/web/src/vite-env.d.ts Adds VITE_API_BASE_URL typing for Vite env.
apps/web/src/api/index.ts Exposes apiClient plus typed wrappers for SDK endpoints.
apps/web/src/api/generated/types.gen.ts Generated API types from the OpenAPI spec.
apps/web/src/api/generated/sdk.gen.ts Generated endpoint functions using the generated fetch client.
apps/web/src/api/generated/index.ts Generated barrel exports for the generated SDK/types.
apps/web/src/api/generated/core/utils.gen.ts Generated URL/path/body utilities used by the client.
apps/web/src/api/generated/core/types.gen.ts Generated core client/type utilities.
apps/web/src/api/generated/core/serverSentEvents.gen.ts Generated SSE client implementation (core).
apps/web/src/api/generated/core/queryKeySerializer.gen.ts Generated query-key serialization helpers.
apps/web/src/api/generated/core/pathSerializer.gen.ts Generated parameter serialization logic for paths/queries.
apps/web/src/api/generated/core/params.gen.ts Generated argument-to-request-params mapping utilities.
apps/web/src/api/generated/core/bodySerializer.gen.ts Generated body + query serializer implementations.
apps/web/src/api/generated/core/auth.gen.ts Generated auth token helpers.
apps/web/src/api/generated/client/utils.gen.ts Generated fetch-client helpers (config, headers, auth, interceptors).
apps/web/src/api/generated/client/types.gen.ts Generated fetch-client types.
apps/web/src/api/generated/client/index.ts Generated exports for the fetch-client layer.
apps/web/src/api/generated/client/client.gen.ts Generated fetch client implementation.
apps/web/src/api/generated/client.gen.ts Generated default client instance (currently hardcoded baseUrl).
apps/web/src/api/client.ts Hand-written apiClient with env/dev/same-origin base URL resolution.
apps/web/README.md Documents OpenAPI client generation/validation usage for the web app.
apps/web/package.json Adds OpenAPI generate/validate scripts and devDependency on @hey-api/openapi-ts.
apps/web/openapi-ts.config.ts Configures OpenAPI input/output for SDK generation.
apps/web/biome.json Excludes generated SDK directory from Biome checks.
apps/web/.env.example Documents VITE_API_BASE_URL usage and defaults.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/src/api/client.ts Outdated
Addresses Copilot: import ClientOptions from the generated fetch client so
baseUrl stays a plain string (same-origin and env) without OpenAPI literal casts.

Made-with: Cursor
- Set REDOCLY_TELEMETRY=off so Redocly does not run npm -v for telemetry (pnpm
  passes npm_config_* keys npm warns about).
- Set REDOCLY_SUPPRESS_UPDATE_NOTICE=true for cleaner output.
- Use cross-env so the lint script works on Windows.

Made-with: Cursor
@mcalthrop mcalthrop merged commit 45789a1 into main Apr 3, 2026
5 checks passed
@mcalthrop mcalthrop deleted the feat/web-openapi-full-client branch April 3, 2026 11:40
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