Skip to content

Enforce generated OpenAPI types as the source of truth for SDK and CLI APIs#1

Open
arawrdn wants to merge 1 commit into
ProjectOpenSea:mainfrom
arawrdn:main
Open

Enforce generated OpenAPI types as the source of truth for SDK and CLI APIs#1
arawrdn wants to merge 1 commit into
ProjectOpenSea:mainfrom
arawrdn:main

Conversation

@arawrdn
Copy link
Copy Markdown

@arawrdn arawrdn commented May 14, 2026

PR Description

This change formalizes the generated OpenAPI types as the single source of truth for all OpenSea v2 SDK and CLI endpoint work.

Performance and Reliability Impact

  • Prevents duplicated hand-written request/response types from drifting from the OpenSea API contract.
  • Reduces runtime mismatch risk by surfacing schema issues during type-checking and build steps.
  • Keeps SDK and CLI consumers aligned with the latest generated @opensea/api-types definitions.
  • Preserves src/generated.ts as a reproducible artifact generated directly from the OpenAPI spec.
  • Improves CI signal quality by ensuring API-path changes are validated against regenerated API types.

Required Development Flow

Before adding or modifying SDK/CLI endpoints:

pnpm --filter @opensea/api-types run update-spec
pnpm --filter @opensea/api-types run build
pnpm --filter sdk run check-types
pnpm --filter cli run build

Engineering Guidance

New endpoints should reuse components["schemas"] or named exports from packages/api-types/src/index.ts instead of introducing parallel local types.

CI enforcement should remain strict around pnpm check-api-paths, ensuring SDK/CLI API-path changes are paired with regenerated packages/api-types updates whenever the OpenAPI spec changes.

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