-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IDL serializer option to coerce inline IO
This commit adds a new IDL serializer configuration, coerceInlineIo, that will use inline IO to write input and output shapes that are only bound to one operation - even if they don't have the input or output trait applied. It also fixes a bug where an empty newline was written before empty inline IO shape definitions.
- Loading branch information
Showing
4 changed files
with
162 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
40 changes: 40 additions & 0 deletions
40
...t/resources/software/amazon/smithy/model/shapes/idl-serialization/coerced-io/after.smithy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
$version: "2.0" | ||
$operationInputSuffix: "Request" | ||
$operationOutputSuffix: "Response" | ||
|
||
namespace com.example | ||
|
||
service InlineService { | ||
operations: [ | ||
MultipleBind1 | ||
MultipleBind2 | ||
WithoutTraits | ||
WithTraits | ||
] | ||
} | ||
|
||
operation MultipleBind1 { | ||
input: MultipleBindRequest | ||
output: MultipleBindResponse | ||
} | ||
|
||
operation MultipleBind2 { | ||
input: MultipleBindRequest | ||
output: MultipleBindResponse | ||
} | ||
|
||
operation WithoutTraits { | ||
input := {} | ||
output := {} | ||
} | ||
|
||
operation WithTraits { | ||
input := { | ||
a: String | ||
} | ||
output := {} | ||
} | ||
|
||
structure MultipleBindRequest {} | ||
|
||
structure MultipleBindResponse {} |
48 changes: 48 additions & 0 deletions
48
.../resources/software/amazon/smithy/model/shapes/idl-serialization/coerced-io/before.smithy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
$version: "2.0" | ||
|
||
namespace com.example | ||
|
||
service InlineService { | ||
operations: [ | ||
MultipleBind1 | ||
MultipleBind2 | ||
WithoutTraits | ||
WithTraits | ||
] | ||
} | ||
|
||
operation MultipleBind1 { | ||
input: MultipleBindRequest | ||
output: MultipleBindResponse | ||
} | ||
|
||
operation MultipleBind2 { | ||
input: MultipleBindRequest | ||
output: MultipleBindResponse | ||
} | ||
|
||
operation WithoutTraits { | ||
input: WithoutTraitsRequest | ||
output: WithoutTraitsResponse | ||
} | ||
|
||
operation WithTraits { | ||
input: WithTraitsRequest | ||
output: WithTraitsResponse | ||
} | ||
|
||
structure MultipleBindRequest {} | ||
|
||
structure MultipleBindResponse {} | ||
|
||
structure WithoutTraitsRequest {} | ||
|
||
structure WithoutTraitsResponse {} | ||
|
||
@input | ||
structure WithTraitsRequest { | ||
a: String | ||
} | ||
|
||
@output | ||
structure WithTraitsResponse {} |