Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow matching a path variable with a different name: @httpLabel("foo") bar: String #2286

Open
jjant opened this issue May 13, 2024 · 0 comments
Labels
feature-request A feature should be added or improved.

Comments

@jjant
Copy link
Contributor

jjant commented May 13, 2024

Hi, I would like the httpLabel to allow matching a path variable with a different name than the input structure field name:

$version: "2"
namespace smithy.example

@readonly
@http(method: "GET", uri: "/{foo}")
operation GetStatus {
    input: GetStatusInput
    output: GetStatusOutput
}

@input
structure GetStatusInput {
    @required
    @httpLabel("foo") // <- New!
    bar: String
}

The reason for this is because we had some paths defined as /{badName} and we wanted the new operations to use /{goodName} (i.e, we want the input structures to have a field named goodName, we don't care about the path variable name).

However, after attempting this (with a Lambda + API Gateway integration), we run into an error like this:

Errors found during import: Unable to create resource at path '/{goodName}/b': A sibling ({badName}) of this resource already has a variable path part -- only one is allowed

@sugmanue sugmanue added the feature-request A feature should be added or improved. label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants