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

fix: use nullable types for all structure members (Java, .NET) #496

Open
wants to merge 6 commits into
base: main-1.x
Choose a base branch
from

Conversation

alex-chew
Copy link
Contributor

Issue #, if available: #278

Description of changes: Changes the .NET and Java code generators to use nullable types for all structure members (even required members with primitive-equivalent shapes).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@alex-chew alex-chew marked this pull request as ready for review August 12, 2024 17:54
@alex-chew alex-chew requested a review from a team as a code owner August 12, 2024 17:54
@alex-chew
Copy link
Contributor Author

Marking this as ready for review despite the unrelated failing CI test (something to do with a Rust-related patch not applying, which we believe is due to unintended nondeterminism in the module order emitted by the Dafny-to-Rust compiler).

Copy link
Contributor

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving an initial blocking review just because I'm not worried that this isn't correct for Smithy 1.0 models, that the better fix is to support @box consistently (it is supported for Java but not .NET AFAICT)

…lexchew/wip-fix-optional-primitives

# Conflicts:
#	TestModels/SimpleTypes/SimpleBoolean/codegen-patches/rust/dafny-4.5.0.patch
#	codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/AwsSdkDotNetNameResolver.java
@texastony
Copy link
Contributor

An issue with going to down further down this path is that Smithy-Dafny is forking the Smithy 1.0 Specification.

Smithy-Dafny could argue that such a change in behavior is necessary to support the Local Service Trait;
but I am not certain that argument is valid,
as I think the Local Service Trait can work without this forking of behavior.

A stronger argument, in favor of the box approach,
or maybe just in dropping Smithy 1.0 and upgrading to 2.0,
is that all Smithy Code Generators should behave same by following the Smithy Specification.

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