Skip to content

feat: Support semantic-method specs without a POST operation per path - #305

Merged
razor-x merged 1 commit into
mainfrom
claude/openapi-semantic-method-gen-bbvsrd
Aug 26, 2026
Merged

feat: Support semantic-method specs without a POST operation per path#305
razor-x merged 1 commit into
mainfrom
claude/openapi-semantic-method-gen-bbvsrd

Conversation

@razor-x

@razor-x razor-x commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

nextlove@4.4.0 generates a single semantic operation per path (the non-POST method for read routes) instead of mirroring every operation onto POST. createEndpoint previously hard-required a post operation and built the endpoint exclusively from it, so semantic-method specs failed with No valid post operation found for /access_codes/create_multiple — this is what's currently failing the "Open PR on seamapi/types" check on seam-connect#17333.

Changes

  1. createEndpoint: when a path has no post operation, build the endpoint from the semantic method's operation (via the existing getSemanticMethod) and restore the POST alias into request.methods — the Seam API accepts POST on every endpoint, the semantic spec just stops documenting the mirror. When a post operation exists, behavior is unchanged (built from POST, methods as-declared).
  2. createRequest: when the endpoint is built from a non-POST operation with no JSON request body (GET/DELETE), derive parameters from the operation's query parameters. Endpoints built from a POST operation keep deriving parameters from the request body only — bit-identical to prior output (this gate matters: /seam/console/v1/get_resource_locator has a bodyless POST with a query param that the old code silently dropped, and an ungated fallback would have changed old-spec output).
  3. ParameterSchema: schema.type is now optional — union query parameters (oneOf/anyOf) carry no top-level type, matching the requestBody schema right below it. The runtime already flattens unions.

Validation: semantic spec ⇒ same blueprint

Built blueprints from seam-connect's POST-mirrored spec (main) and its regenerated semantic-method spec (seam-connect#17333), then compared endpoint-by-endpoint:

Category Count Notes
Endpoints on each side 318 / 318 none gained or lost
Byte-identical endpoints 244
Parameter order only (same params, same content) 56 body-property order vs query-parameter order
Method order only ([POST,PUT][PUT,POST]; same semanticMethod) 10
Intended: deprecated PUT removed (methods 3→2, semanticMethod PUTPATCH) 2 /access_codes/update, /noise_sensors/noise_thresholds/update — these previously documented the deprecated PUT as the semantic method
Improvement: previously-dropped query param now documented 1 /seam/console/v1/get_resource_locator gains uuid
⚠️ Spec-side gap: union-typed params lost 5 see below

The 5-endpoint gap is in nextlove's generation, not blueprint: /access_grants/get, /access_methods/delete, /connected_accounts/get, /spaces/get, /user_identities/get use union-typed (z.union) commonParams. The generated schema has no top-level .properties (only oneOf), so nextlove's GET generation emits no query parameters at all — the information is absent from the semantic spec, and blueprint cannot recover it. (The old POST body carried the full oneOf, which blueprint flattened into all-optional params.) A companion nextlove PR flattens union schemas into query parameters, after which these 5 converge too.

Also npm test passes in full — including the seam-blueprint snapshot against the real published @seamapi/types spec, which proves old-spec output is unchanged — plus two new unit tests: a semantic-method endpoint (methods [GET, POST], params from query) and a deep-equality test that a semantic-method spec produces the same endpoint object as its POST-mirrored equivalent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UgJLypfYKgaoAYq7fKy4fs


Generated by Claude Code

nextlove 4.4.0 generates a single semantic operation per path (the
non-POST method for read routes) instead of mirroring every operation
onto POST. createEndpoint previously required a post operation and built
the endpoint exclusively from it, so such specs failed with "No valid
post operation found".

- Build the endpoint from the semantic method's operation when a path
  has no post operation, and restore the POST alias to request.methods
  (the Seam API accepts POST on every endpoint), so a semantic-method
  spec produces the same blueprint as a POST-mirrored one.
- Derive request parameters from the operation's query parameters when
  the endpoint is built from a non-POST operation without a JSON request
  body. Endpoints built from a POST operation keep deriving parameters
  from the request body only, bit-identical to prior output.
- Allow query parameter schemas without a top-level type in
  OpenapiOperationSchema (union schemas carry oneOf/anyOf instead),
  matching the requestBody schema's existing optional type.

Validated by building blueprints from seam-connect's POST-mirrored spec
and its regenerated semantic-method spec: 318 endpoints on both sides,
none gained or lost; all diffs are parameter/method order, intended
deprecated-PUT removals, or spec-side fidelity gaps documented in the PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UgJLypfYKgaoAYq7fKy4fs
@razor-x
razor-x requested a review from a team as a code owner August 26, 2026 08:28
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blueprint Ready Ready Preview Aug 26, 2026 8:28am

Request Review

@razor-x razor-x changed the title Support semantic-method specs without a POST operation per path feat: Support semantic-method specs without a POST operation per path Aug 26, 2026
@razor-x
razor-x merged commit 664e8f6 into main Aug 26, 2026
17 checks passed
@razor-x
razor-x deleted the claude/openapi-semantic-method-gen-bbvsrd branch August 26, 2026 17:07
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