Skip to content

fix: Generate missing simulate endpoints#527

Merged
razor-x merged 1 commit into
mainfrom
claude/codegen-cleanup-blueprint-hms4b2
Jul 21, 2026
Merged

fix: Generate missing simulate endpoints#527
razor-x merged 1 commit into
mainfrom
claude/codegen-cleanup-blueprint-hms4b2

Conversation

@razor-x

@razor-x razor-x commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

This PR migrates the Ruby SDK code generator from parsing raw OpenAPI schemas to using the @seamapi/blueprint types and data structures. This eliminates temporary workaround code and aligns the generator with the blueprint-driven architecture.

Key Changes

  • Removed OpenAPI parsing layer: Deleted temporary OpenAPI utility files (get-parameter-and-response-schema.ts, deep-flatten-one-of-and-all-of-schema.ts, flatten-obj-schema.ts, types.ts, map-parent-to-children-resource.ts, get-filtered-routes.ts) that were frozen output-parity workarounds
  • Removed endpoint filtering rules: Deleted endpoint-rules.ts which contained hardcoded lists of ignored paths and deprecated endpoints
  • Refactored resource generation: Now derives resources directly from blueprint.resources, with special handling for merged event variants and action attempts
  • Refactored client generation: Replaced OpenAPI-based client discovery with blueprint-driven approach using blueprint.routes and blueprint.namespaces, properly handling parent-child client relationships
  • Simplified endpoint processing: Client methods are now created directly from blueprint Endpoint objects instead of parsing OpenAPI POST operations
  • Updated resource layout context: Changed from accepting OpenAPI ObjSchema to accepting blueprint Property[] arrays
  • Removed deprecated action attempt handling: Deleted special-case logic for endpoints returning deprecated action attempts

Implementation Details

  • Resources are now sorted alphabetically and include merged properties from event variants and action attempts
  • Client namespaces are derived from route/namespace paths using a consistent getClientNamespace() function
  • Endpoint filtering now uses blueprint isUndocumented flags instead of hardcoded path lists
  • Return type resolution uses blueprint Response objects with proper handling for batch responses and unknown resource types
  • Parameter ordering preserves the original quirk where position 0 parameters are treated as optional (for output parity)

https://claude.ai/code/session_01RRu8RHUZqw3SvrGR7NJCki

…print

The Metalsmith codegen kept verbatim OpenAPI-parsing ports from the
nextlove generator (marked TEMPORARY) so its output stayed byte-identical.
Now that the output is allowed to change, generate everything from
@seamapi/blueprint and delete the OpenAPI workarounds:

- Delete codegen/lib/openapi/ and endpoint-rules.ts. The blueprint has no
  /health routes, and the endpoints that formerly returned a deprecated
  action attempt are modeled as void responses, so neither list is needed.
- Generate resources from blueprint.resources, blueprint.actionAttempts,
  and blueprint.pagination. SeamEvent and ActionAttempt merge the union of
  their per-variant properties so every accessor is preserved.
- Generate clients from blueprint.routes and blueprint.namespaces, using
  their isUndocumented flags for filtering and parentPath for wiring child
  clients, which now also wires deeply nested namespaces
  (AcsEncoders#simulate).
- Fix the parameter sort so an explicit position sorts first, as
  originally intended.

Resulting output changes: AcsEncoders#simulate is now reachable from its
parent client, workspaces.update is generated, the unused
phone_registration resource is dropped, SeamEvent accessors are
alphabetized, and the primary id parameter of get methods moves to the
front of the signature.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRu8RHUZqw3SvrGR7NJCki
@razor-x
razor-x marked this pull request as ready for review July 21, 2026 23:23
@razor-x razor-x changed the title Migrate Ruby SDK codegen to use blueprint instead of OpenAPI fix: Generate missing simulate endpoints Jul 21, 2026
@razor-x
razor-x merged commit 8865ded into main Jul 21, 2026
17 checks passed
@razor-x
razor-x deleted the claude/codegen-cleanup-blueprint-hms4b2 branch July 21, 2026 23:24
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