-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
treat all members as clientOptional when container is marked with @input
- Loading branch information
Showing
6 changed files
with
47 additions
and
4 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
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 |
---|---|---|
|
@@ -394,6 +394,7 @@ class SymbolProviderTest { | |
@input | ||
structure MyStruct { | ||
@required | ||
@default(2) | ||
quux: QuuxType | ||
} | ||
|
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
28 changes: 28 additions & 0 deletions
28
...s/codegen/nullability-tests/src/test/kotlin/smithy/kotlin/nullability/DefaultValueTest.kt
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,28 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package smithy.kotlin.nullability | ||
|
||
import kotlin.test.Test | ||
import kotlin.test.assertNull | ||
|
||
class DefaultValueTest { | ||
@Test | ||
fun testDefaultsClientMode() { | ||
val actual = smithy.kotlin.nullability.client.model.SayHelloRequest.Builder() | ||
.build() | ||
|
||
// all members of structure marked with `@input` are implicitly `@clientOptional` | ||
assertNull(actual.tay) | ||
} | ||
|
||
@Test | ||
fun testDefaultsClientCarefulMode() { | ||
val actual = smithy.kotlin.nullability.clientcareful.model.SayHelloRequest.Builder() | ||
.build() | ||
|
||
// all members of structure marked with `@input` are implicitly `@clientOptional` | ||
assertNull(actual.tay) | ||
} | ||
} |
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