smithy-lang / smithy

Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
https://smithy.io
Apache License 2.0
1.7k stars 201 forks source link

add ability to apply trait to inline inputs/outputs #2302

Closed lenguyenthanh closed 1 month ago

lenguyenthanh commented 1 month ago

I would love to have ability to apply trait to inline input/output for examples:

@http(method: "GET", uri: "/api/api", code: 200)
operation SomeOperator {

  @sometrait()
  input := {
    x: String
  }
}
kstich commented 1 month ago

This is supported, just in a slightly different location (see Smithy IDL spec on inline I/O):

@http(method: "GET", uri: "/api/api", code: 200)
operation SomeOperator {
    input := @sometrait( ... ) {
        x: String
    }
}