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

Stop Auto-Renaming of Input/Output Structures #3577

Open
drganjoo opened this issue Apr 11, 2024 · 1 comment
Open

Stop Auto-Renaming of Input/Output Structures #3577

drganjoo opened this issue Apr 11, 2024 · 1 comment
Labels
breaking-change This will require a breaking change server Rust server SDK

Comments

@drganjoo
Copy link
Contributor

Smithy allows the definition of operations without associated input or output structures. However, adding these structures is considered a backward-compatible change according to the specifications. When generating a Smithy client, the API call for the operation requires a parameter that represents the operation's input as defined in the model. Since adding an input to an operation is intended to be a backward-compatible change (Smtihy Specs), any modifications to the model would necessitate changes in the user code that invokes the generated code, if it previously did not require a structure. This is why the client always generates input/output structures, even if they are not defined in the model. The code generator names these by suffixing "Input" or "Output" to the name of the operation. To maintain consistency, for cases where the operation defines an input or output structure, it renames them to match the same naming convention: the input structure will be called OperationNameInput, and the output structure will be called OperationNameOutput.

On the server side, however, when such changes are implemented, the server must process the request differently, and the corresponding code must be updated. This requirement is nearly a mandatory aspect of the specification for servers. The server follows the same convention as the client in that it also renames input/output structures. However, this causes confusion for service authors. Additionally, when we implement a plugin that will allow users to generate Rust structures (Issue #:1370) only from a model without generating service code, we would need to allow them to name the structures whatever they want and not rename them.

This issue is to stop renaming these input/output structures on the server side.

Note: This will be a breaking change.

@drganjoo drganjoo added server Rust server SDK high-priority High priority issue labels Apr 11, 2024
@david-perez david-perez added breaking-change This will require a breaking change and removed high-priority High priority issue labels Apr 11, 2024
@david-perez
Copy link
Contributor

However, adding these structures is considered a backward-compatible change according to the specifications.

It looks like this is not the case. It's a breaking change from Smithy's perspective too: smithy-lang/smithy#2253 (comment)

It looks like clients only rename operation input/output shapes for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will require a breaking change server Rust server SDK
Projects
None yet
Development

No branches or pull requests

2 participants