fix(smithy): use greedy functionName label to allow sub-path invocation#58
Draft
mandarini wants to merge 1 commit into
Draft
fix(smithy): use greedy functionName label to allow sub-path invocation#58mandarini wants to merge 1 commit into
mandarini wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found during the JavaScript SDK codegen spike:
functions.smithytypesfunctionNameas 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.smithyalready uses forwildcardPath+.Changes
smithy/model/functions.smithy— all five@httpuris:{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 segmentNotes
smithy buildcurrently fails on a clean clone (see #51 discussion). The diff is minimal and formatting-preserving: 11 changed lines across both files.@hey-api/openapi-tsconsumes the patched artifact and emits the path param as a raw greedy segment (same behavior as the generated Storage client'swildcardPath+).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