From 1507ea19e4eb591a172b2ef57a393497154d06e6 Mon Sep 17 00:00:00 2001 From: Richard Chen Date: Mon, 14 Aug 2023 19:19:33 -0400 Subject: [PATCH] Emit warning on addition of @required trait. --- .../amazon/smithy/model/loader/prelude.smithy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy b/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy index 54da6f88b18..5235d6dcee9 100644 --- a/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy +++ b/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy @@ -721,7 +721,16 @@ string pattern /// Marks a structure member as required, meaning a value for the member MUST /// be present. -@trait(selector: "structure > member") +@trait( + selector: "structure > member" + breakingChanges: [ + { + change: "add" + severity: "WARNING" + message: "If any consumers were previously omitting this member in operation inputs, making it required is backwards incompatible" + } + ] +) structure required {} /// Configures a structure member's resource property mapping behavior.