-
Notifications
You must be signed in to change notification settings - Fork 103
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
Members on models are always type or undefined
#503
Comments
It's been considered backwards compatible for Smithy services to remove We know this is a very annoying thing to have to work around in code. We have a proposal for a trait that allows this change to be made backwards-compatibly without including |
This unfortunately makes Smithy SDKs tedious to use. For those of us willing to sacrifice backwards compatibility, could there be a flag to allow the more precise SDK generation? |
This policy only makes sense on input shapes; it's the inverse when it comes to outputs – introducing To that end, I wonder if @eduardomourar's PR #566 wouldn't be substantially easier to accept if it was limited in scope to just output structures. Am I missing something? |
I discovered this behavior while evaluating whether to use the code generator. Which, if I read the openapi and the smithy requirements correctly, seems to be a bug.
As of my understanding you need to declare a value as nullable in the smithy file otherwise it would be not nullable. Therefore I would expect the following behavior:
I would really appreciate if you could elaborate on this issue and the PRs #566 & #537 @adamthom-amzn @trivikr |
This is indeed an annoying issue. And the only thing that holds us from using Smithy. Our concern is that this could cause bugs in the future and it requires manual ugly work arounds. Is there any update on this? |
See #566 |
Mentioned this in the PR comments, but repeating it here for anyone looking to use this feature. Wherever this flag is defined and documented, there should be some warning language calling out the risks of using this mode. The risks are that when a server drops
So one should use this mode on the client, only if the server is following this. |
Resolved by PR #566 |
For the SSDK side, created issue #694 |
Hello,
The generated typescript types for structures have members that are always either the type or
undefined
.E.g.
Even though these members have a
@required
trait applied to them. Can you elaborate a bit on the motivation here and if there is a way to prevent this from happening?The text was updated successfully, but these errors were encountered: