Skip to content

fix(smithy): use greedy functionName label to allow sub-path invocation#58

Draft
mandarini wants to merge 1 commit into
feat/smithy-modelsfrom
fix/functions-greedy-path
Draft

fix(smithy): use greedy functionName label to allow sub-path invocation#58
mandarini wants to merge 1 commit into
feat/smithy-modelsfrom
fix/functions-greedy-path

Conversation

@mandarini

@mandarini mandarini commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Found during the JavaScript SDK codegen spike: functions.smithy types functionName as a plain @httpLabel, so generated clients percent-encode slashes in the function name — invoke('my-fn/some/route') becomes /functions/v1/my-fn%2Fsome%2Froute. Sub-path invocation is a real Edge Functions use case, and the hand-written SDK clients support it today by appending the name unencoded.

This switches the path segment to a greedy label, the same convention storage.smithy already uses for wildcardPath+.

Changes

  • smithy/model/functions.smithy — all five @http uris: {functionName}{functionName+}
  • smithy/openapi/FunctionsService.openapi.json — path key and the five path parameters renamed to match (functionName+), mirroring how the committed Storage artifact represents its greedy segment

Notes

  • The OpenAPI artifact was patched by hand rather than regenerated, since smithy build currently fails on a clean clone (see #51 discussion). The diff is minimal and formatting-preserving: 11 changed lines across both files.
  • Verified downstream: @hey-api/openapi-ts consumes the patched artifact and emits the path param as a raw greedy segment (same behavior as the generated Storage client's wildcardPath+).

Targets feat/smithy-models (#51), per its "living draft" process — one of the model gaps the JS spike was asked to feed back.

🤖 Generated with Claude Code

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