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

Validate that query literal do not conflict with query params #1786

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

sugmanue
Copy link
Contributor

Issue #, if available:

Description of changes:

Validate that query literal do not conflict with query params. Currently is possible to define a model like the following, that defines code as a query literal in the URI part of the @http trait and also the same query param in the OperationOneShape. This change will disallow this model that is not valid in practice.

$version: "2"
namespace smithy.example

// OperationOne defines a query literal `code` that conflicts with the
// query param defined in the input structure.

service SmithyExample {
    operations: [
        OperationOne
    ]
}

@http(code: 200, method: "GET", uri: "/example?code")
@readonly
operation OperationOne {
    input: OperationOneInput
    output: OperationOneOutput
}

structure OperationOneInput {
    @httpQuery("code")
    code: String

    @httpQuery("state")
    state: String
}

structure OperationOneOutput {
    @required
    @httpHeader("Content-Type")
    contentType: String

    @required
    @httpPayload
    content: Blob
}

@sugmanue sugmanue requested a review from a team as a code owner May 24, 2023 16:19
@sugmanue sugmanue merged commit 567d7af into smithy-lang:main Jun 1, 2023
mtdowling pushed a commit that referenced this pull request Jun 2, 2023
* Validate that query literal do not conflict with query params

* Address PR comments
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
…-lang#1786)

* Validate that query literal do not conflict with query params

* Address PR comments
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.

3 participants