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

Incorrect routing when the URL differs by a static query param only #1619

Open
msosnicki opened this issue Nov 8, 2024 · 2 comments
Open

Comments

@msosnicki
Copy link
Contributor

msosnicki commented Nov 8, 2024

The example below, while is a valid smithy, fails to be routed correctly by smithy4s. The routing mechanism uses a combination of HTTP method and path, where path is just a part without query params. As a result, one of these endpoint will be receiving both types of requests.

$version: "2"

namespace example

use alloy#simpleRestJson

@simpleRestJson
service ExampleService {
  version: "1.0.0",
  operations: [GetQuery, GetQueryStatic]
}

@http(method: "GET", uri: "/get-query")
operation GetQuery {
}

@http(method: "GET", uri: "/get-query?static")
operation GetQueryStatic {
}
@Baccata
Copy link
Contributor

Baccata commented Dec 3, 2024

mmm interesting. We need to define some form of ordering of uri patterns.

@kubukoz
Copy link
Member

kubukoz commented Dec 3, 2024

for ordering, #1567 - https://smithy.io/2.0/spec/http-bindings.html#specificity-routing Example 2 shows what to do when ? is present.

worth noting, we do seemingly support static query params (HttpEndpoint has staticQueryParams, which I didn't know).


so maybe this is just a dupe of #1567 after all?

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

No branches or pull requests

3 participants