Remove internal enum values from validation message #713
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The enum validation protocol tests were updated in smithy-lang/smithy#1658 to remove enum values with the
@internal
trait, or which have been tagged withinternal
. For Smithy IDL 1.0 models which must use the@enum
trait (a proper enum shape was introduced with IDL 2.0), the only option for marking an enum value as internal is to use the "internal" tag. For IDL 2.0 models, the preferred way is to use an enum shape, and apply the@internal
trait. When Smithy upgrades an enum trait to an enum shape, or downgrades an enum shape to an enum trait, the tags are copied, including aninternal
tag, but the downgrade does not retain the@internal
trait since it cannot be applied to the@enum
trait.For example:
Validation for the above
Fruit
enum will check that input is any of the four enum values, but the validation message returned will only include the non-internal values,apple
andbanana
. The same is applied for models which have non-synthetic enum traits, which have not been upgrade to enum shapes.When https://github.com/aws/aws-sdk-js-v3 updates to use the smithy release that contains smithy-lang/smithy#1658, a PR will be cut to update the generated validation tests.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.