Skip to content

Commit

Permalink
Reduce invalid set type errors to WARNING
Browse files Browse the repository at this point in the history
It's too big of a churn right now to actually break builds that use dangerous
types with sets. This change leaves the documentation as-is, so the only way to
use a set with a dangerous type is experimentation or having already done so.
  • Loading branch information
adamthom-amzn committed Mar 10, 2022
1 parent 21df1ac commit c1a898e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ private Optional<ValidationEvent> validateSetMember(Shape shape, ShapeId target,
}

if (!VALID_SET_TARGETS.contains(targetShape.getType())) {
return Optional.of(error(shape, format(
return Optional.of(warning(shape, format(
"Set member targets %s, but sets can target only %s. You can model a collection of %s shapes "
+ "by changing this shape to a list. Modeling a set of values of other types is problematic "
+ "to support across a wide range of programming languages.",
+ "to support across a wide range of programming languages. This will be upgraded to an ERROR "
+ "in a future release.",
targetShape,
VALID_SET_TARGETS.stream().map(ShapeType::toString).sorted().collect(Collectors.joining(", ")),
targetShape.getType())));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[ERROR] smithy.example#TimestampSet: Set member targets (timestamp: `smithy.api#Timestamp`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of timestamp shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#BooleanSet: Set member targets (boolean: `smithy.api#Boolean`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of boolean shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#DoubleSet: Set member targets (double: `smithy.api#Double`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of double shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#FloatSet: Set member targets (float: `smithy.api#Float`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of float shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#DocumentSet: Set member targets (document: `smithy.api#Document`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of document shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#ListSet: Set member targets (list: `smithy.example#StringList`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of list shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#SetSet: Set member targets (set: `smithy.example#StringSet`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of set shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#MapSet: Set member targets (map: `smithy.example#StringMap`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of map shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#StructSet: Set member targets (structure: `smithy.example#StructureExample`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of structure shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[ERROR] smithy.example#UnionSet: Set member targets (union: `smithy.example#UnionExample`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of union shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. | Target
[WARNING] smithy.example#TimestampSet: Set member targets (timestamp: `smithy.api#Timestamp`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of timestamp shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#BooleanSet: Set member targets (boolean: `smithy.api#Boolean`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of boolean shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#DoubleSet: Set member targets (double: `smithy.api#Double`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of double shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#FloatSet: Set member targets (float: `smithy.api#Float`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of float shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#DocumentSet: Set member targets (document: `smithy.api#Document`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of document shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#ListSet: Set member targets (list: `smithy.example#StringList`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of list shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#SetSet: Set member targets (set: `smithy.example#StringSet`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of set shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#MapSet: Set member targets (map: `smithy.example#StringMap`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of map shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#StructSet: Set member targets (structure: `smithy.example#StructureExample`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of structure shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[WARNING] smithy.example#UnionSet: Set member targets (union: `smithy.example#UnionExample`), but sets can target only bigDecimal, bigInteger, blob, byte, integer, long, short, string. You can model a collection of union shapes by changing this shape to a list. Modeling a set of values of other types is problematic to support across a wide range of programming languages. This will be upgraded to an ERROR in a future release. | Target
[ERROR] smithy.example#StreamingBlobSet: Set member targets (blob: `smithy.example#StreamingBlob`), a shape marked with the @streaming trait. | Target
[ERROR] smithy.example#StreamingStringSet: Set member targets (string: `smithy.example#StreamingString`), a shape marked with the @streaming trait. | Target

0 comments on commit c1a898e

Please sign in to comment.