diff --git a/.changes/next-release/feature-0dad6fe920f7dc053e14bed2d43b2e553a2f142a.json b/.changes/next-release/feature-0dad6fe920f7dc053e14bed2d43b2e553a2f142a.json new file mode 100644 index 00000000000..a72ef5b2613 --- /dev/null +++ b/.changes/next-release/feature-0dad6fe920f7dc053e14bed2d43b2e553a2f142a.json @@ -0,0 +1,7 @@ +{ + "type": "feature", + "description": "Add new shapeExamples to express allowed and disallowed values on an individual shape level", + "pull_requests": [ + "[#2851](https://github.com/smithy-lang/smithy/pull/2851)" + ] +} diff --git a/docs/source-2.0/spec/documentation-traits.rst b/docs/source-2.0/spec/documentation-traits.rst index b7a27c326fe..5650dcfd0c8 100644 --- a/docs/source-2.0/spec/documentation-traits.rst +++ b/docs/source-2.0/spec/documentation-traits.rst @@ -355,6 +355,55 @@ Value type ``string`` representing the date it was added. +.. smithy-trait:: smithy.api#shapeExamples +.. _shapeExamples-trait: + +``shapeExamples`` trait +======================= + +Summary + Defines values which are specifically allowed and/or disallowed for a + shape. + + These shape example values are validated within the model to ensure there + is consistency between the shape author's intent and the shape's configured + :doc:`constraint traits `. +Trait selector + ``:test(number, string, blob, structure, list, map, member)`` +Value type + Structure with the following members: + + .. list-table:: + :header-rows: 1 + :widths: 10 10 80 + + * - Property + - Type + - Description + * - allowed + - ``[document]`` + - Provides a list of values which are explicitly valid per the + shape's definition. + * - disallowed + - ``[document]``` + - Provides a list of values which are explicitly invalid per the + shape's definition. + +One of either ``allowed`` or ``disallowed`` MUST be provided. When ``allowed`` +or ``disallowed`` is defined, it MUST have at least one value. + +.. tabs:: + + .. code-tab:: smithy + + @shapeExamples({ + allowed: ["a"] + disallowed: ["aa"] + }) + @length(min: 1, max: 1) + string MyString + + .. smithy-trait:: smithy.api#tags .. _tags-trait: diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/traits/ShapeExamplesTrait.java b/smithy-model/src/main/java/software/amazon/smithy/model/traits/ShapeExamplesTrait.java new file mode 100644 index 00000000000..0ee1bbd2430 --- /dev/null +++ b/smithy-model/src/main/java/software/amazon/smithy/model/traits/ShapeExamplesTrait.java @@ -0,0 +1,124 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package software.amazon.smithy.model.traits; + +import java.util.List; +import java.util.Optional; +import software.amazon.smithy.model.SourceException; +import software.amazon.smithy.model.node.ArrayNode; +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.node.ObjectNode; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.utils.MapUtils; +import software.amazon.smithy.utils.ToSmithyBuilder; + +/** + * Defines values which are specifically allowed and/or disallowed for a shape. + */ +public final class ShapeExamplesTrait extends AbstractTrait implements ToSmithyBuilder { + public static final ShapeId ID = ShapeId.from("smithy.api#shapeExamples"); + + private final List allowed; + private final List disallowed; + + private ShapeExamplesTrait(ShapeExamplesTrait.Builder builder) { + super(ID, builder.sourceLocation); + this.allowed = builder.allowed; + this.disallowed = builder.disallowed; + if (allowed == null && disallowed == null) { + throw new SourceException("One of 'allowed' or 'disallowed' must be provided.", getSourceLocation()); + } + if (allowed != null && allowed.isEmpty()) { + throw new SourceException("'allowed' must be non-empty when provided.", getSourceLocation()); + } + if (disallowed != null && disallowed.isEmpty()) { + throw new SourceException("'disallowed' must be non-empty when provided.", getSourceLocation()); + } + } + + /** + * Gets the allowed values. + * + * @return returns the optional allowed values. + */ + public Optional> getAllowed() { + return Optional.ofNullable(allowed); + } + + /** + * Gets the disallowed values. + * + * @return returns the optional disallowed values. + */ + public Optional> getDisallowed() { + return Optional.ofNullable(disallowed); + } + + @Override + protected Node createNode() { + return new ObjectNode(MapUtils.of(), getSourceLocation()) + .withOptionalMember("allowed", getAllowed().map(ArrayNode::fromNodes)) + .withOptionalMember("disallowed", getDisallowed().map(ArrayNode::fromNodes)); + } + + @Override + public ShapeExamplesTrait.Builder toBuilder() { + return builder().allowed(allowed).disallowed(disallowed).sourceLocation(getSourceLocation()); + } + + /** + * @return Returns a new ShapeExamplesTrait builder. + */ + public static ShapeExamplesTrait.Builder builder() { + return new ShapeExamplesTrait.Builder(); + } + + /** + * Builder used to create a ShapeExamplesTrait. + */ + public static final class Builder extends AbstractTraitBuilder { + private List allowed; + private List disallowed; + + public ShapeExamplesTrait.Builder allowed(List allowed) { + this.allowed = allowed; + return this; + } + + public ShapeExamplesTrait.Builder disallowed(List disallowed) { + this.disallowed = disallowed; + return this; + } + + @Override + public ShapeExamplesTrait build() { + return new ShapeExamplesTrait(this); + } + } + + public static final class Provider implements TraitService { + @Override + public ShapeId getShapeId() { + return ID; + } + + @Override + public ShapeExamplesTrait createTrait(ShapeId target, Node value) { + ShapeExamplesTrait.Builder builder = builder().sourceLocation(value.getSourceLocation()); + value.expectObjectNode() + .getMember("allowed", ShapeExamplesTrait.Provider::convertToShapeExampleList, builder::allowed) + .getMember("disallowed", + ShapeExamplesTrait.Provider::convertToShapeExampleList, + builder::disallowed); + ShapeExamplesTrait result = builder.build(); + result.setNodeCache(value); + return result; + } + + private static List convertToShapeExampleList(Node node) { + return node.expectArrayNode().getElements(); + } + } +} diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java index a602d9972a4..f762df67902 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java @@ -373,7 +373,9 @@ public List unionShape(UnionShape shape) { return value.asObjectNode() .map(object -> { List events = applyPlugins(shape); - if (object.size() > 1) { + if (object.isEmpty()) { + events.add(event("union values must contain a value for exactly one member")); + } else if (object.size() > 1) { events.add(event("union values can contain a value for only a single member")); } else { Map members = shape.getAllMembers(); @@ -395,16 +397,19 @@ public List unionShape(UnionShape shape) { @Override public List memberShape(MemberShape shape) { List events = applyPlugins(shape); - if (value.isNullNode()) { + + if (!value.isNullNode()) { + model.getShape(shape.getTarget()).ifPresent(target -> { + // We only need to keep track of a single referring member, so a stack of members or anything like that + // isn't needed here. + validationContext.setReferringMember(shape); + events.addAll(target.accept(this)); + validationContext.setReferringMember(null); + }); + } else { events.addAll(checkNullMember(shape)); } - model.getShape(shape.getTarget()).ifPresent(target -> { - // We only need to keep track of a single referring member, so a stack of members or anything like that - // isn't needed here. - validationContext.setReferringMember(shape); - events.addAll(target.accept(this)); - validationContext.setReferringMember(null); - }); + return events; } @@ -421,11 +426,22 @@ public List checkNullMember(MemberShape shape) { String.format( "Non-sparse map shape `%s` cannot contain null values", shape.getContainer()))); + case SET: + return ListUtils.of(event( + String.format( + "Set shape `%s` cannot contain null values", + shape.getContainer()))); case STRUCTURE: return ListUtils.of(event( String.format("Required structure member `%s` for `%s` cannot be null", shape.getMemberName(), shape.getContainer()))); + case UNION: + return ListUtils.of(event( + String.format( + "Union member `%s` for `%s` cannot contain null values", + shape.getMemberName(), + shape.getContainer()))); default: break; } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/BlobLengthPlugin.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/BlobLengthPlugin.java index 425d72ffa3f..d69c3b6c206 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/BlobLengthPlugin.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/BlobLengthPlugin.java @@ -29,7 +29,12 @@ protected void check(Shape shape, LengthTrait trait, StringNode node, Context co byte[] value = node.getValue().getBytes(StandardCharsets.UTF_8); if (context.hasFeature(NodeValidationVisitor.Feature.REQUIRE_BASE_64_BLOB_VALUES)) { - value = Base64.getDecoder().decode(value); + try { + value = Base64.getDecoder().decode(value); + } catch (IllegalArgumentException e) { + // Error will reported by the blobShape method in NodeValidationVisitor + return; + } } int size = value.length; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java index b721e4811f2..e9dd8cad88e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java @@ -22,6 +22,7 @@ import software.amazon.smithy.model.validation.Severity; import software.amazon.smithy.model.validation.ValidatedResult; import software.amazon.smithy.model.validation.ValidationEvent; +import software.amazon.smithy.model.validation.ValidationEventFormatter; import software.amazon.smithy.model.validation.Validator; import software.amazon.smithy.utils.IoUtils; @@ -33,6 +34,8 @@ public final class SmithyTestCase { private static final Pattern EVENT_PATTERN = Pattern.compile( "^\\[(?SUPPRESSED|NOTE|WARNING|DANGER|ERROR)] (?[^ ]+): ?(?.*) \\| (?[^)]+)"); + private static final ValidationEventFormatter VALIDATION_EVENT_FORMATTER = new ErrorsFileValidationEventFormatter(); + private final List expectedEvents; private final String modelLocation; @@ -222,7 +225,7 @@ public String toString() { builder.append("\nDid not match the following events\n" + "----------------------------------\n"); for (ValidationEvent event : getUnmatchedEvents()) { - builder.append(event.toString().replace("\n", "\\n")).append('\n'); + builder.append(VALIDATION_EVENT_FORMATTER.format(event)).append('\n'); } builder.append('\n'); } @@ -231,7 +234,7 @@ public String toString() { builder.append("\nEncountered unexpected events\n" + "-----------------------------\n"); for (ValidationEvent event : getExtraEvents()) { - builder.append(event.toString().replace("\n", "\\n")).append("\n"); + builder.append(VALIDATION_EVENT_FORMATTER.format(event)).append("\n"); } builder.append('\n'); } @@ -295,4 +298,25 @@ public static final class Error extends RuntimeException { this.result = result; } } + + private static final class ErrorsFileValidationEventFormatter implements ValidationEventFormatter { + @Override + public String format(ValidationEvent event) { + String message = event.getMessage(); + + String reason = event.getSuppressionReason().orElse(null); + if (reason != null) { + message += " (" + reason + ")"; + } + + String formattedEventString = String.format( + "[%s] %s: %s | %s", + event.getSeverity(), + event.getShapeId().map(ShapeId::toString).orElse("-"), + message, + event.getId()); + + return formattedEventString.replace("\n", "\\n"); + } + } } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ShapeExamplesTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ShapeExamplesTraitValidator.java new file mode 100644 index 00000000000..e5aaf5675c9 --- /dev/null +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ShapeExamplesTraitValidator.java @@ -0,0 +1,87 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package software.amazon.smithy.model.validation.validators; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.node.internal.NodeHandler; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.traits.ShapeExamplesTrait; +import software.amazon.smithy.model.validation.AbstractValidator; +import software.amazon.smithy.model.validation.NodeValidationVisitor; +import software.amazon.smithy.model.validation.Severity; +import software.amazon.smithy.model.validation.ValidationEvent; +import software.amazon.smithy.utils.ListUtils; + +/** + * Emits a validation event if a shape examples conflict with their configured validation traits. + */ +public final class ShapeExamplesTraitValidator extends AbstractValidator { + + @Override + public List validate(Model model) { + List events = new ArrayList<>(); + for (Shape shape : model.getShapesWithTrait(ShapeExamplesTrait.class)) { + validateTestValuesTrait(events, model, shape); + } + + return events; + } + + private void validateTestValuesTrait(List events, Model model, Shape shape) { + ShapeExamplesTrait trait = shape.expectTrait(ShapeExamplesTrait.class); + + List allowedValueNodes = trait.getAllowed().orElseGet(ListUtils::of); + for (int index = 0; index < allowedValueNodes.size(); index += 1) { + Node allowedValueNode = allowedValueNodes.get(index); + + NodeValidationVisitor visitor = NodeValidationVisitor.builder() + .model(model) + .eventId(getName() + ".allowed." + index) + .eventShapeId(shape.getId()) + .value(allowedValueNode) + .startingContext(String.format("Allowed shape example `%s`", + NodeHandler.print(allowedValueNode))) + .addFeature(NodeValidationVisitor.Feature.REQUIRE_BASE_64_BLOB_VALUES) + .build(); + + events.addAll(shape.accept(visitor)); + } + + List disallowedValueNodes = trait.getDisallowed().orElseGet(ListUtils::of); + for (int index = 0; index < disallowedValueNodes.size(); index += 1) { + Node disallowedValueNode = disallowedValueNodes.get(index); + + NodeValidationVisitor visitor = NodeValidationVisitor.builder() + .model(model) + .eventId(getName() + ".disallowed." + index) + .eventShapeId(shape.getId()) + .value(disallowedValueNode) + .startingContext(String.format("Disallowed shape example `%s`", + NodeHandler.print(disallowedValueNode))) + .addFeature(NodeValidationVisitor.Feature.REQUIRE_BASE_64_BLOB_VALUES) + .build(); + + List validationEvents = shape.accept(visitor); + List nonErrorValidationEvents = validationEvents.stream() + .filter(validationEvent -> validationEvent.getSeverity() != Severity.ERROR) + .collect(Collectors.toList()); + + events.addAll(nonErrorValidationEvents); + + if (validationEvents.size() == nonErrorValidationEvents.size()) { + events.add(error(shape, + disallowedValueNode, + String.format("Disallowed shape example `%s` passed all validations when it shouldn't have", + NodeHandler.print(disallowedValueNode)), + "disallowed", + Integer.toString(index))); + } + } + } +} diff --git a/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService b/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService index 331eef6362a..14599ef34eb 100644 --- a/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService +++ b/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService @@ -58,6 +58,7 @@ software.amazon.smithy.model.traits.RequiresLengthTrait$Provider software.amazon.smithy.model.traits.ResourceIdentifierTrait$Provider software.amazon.smithy.model.traits.RetryableTrait$Provider software.amazon.smithy.model.traits.SensitiveTrait$Provider +software.amazon.smithy.model.traits.ShapeExamplesTrait$Provider software.amazon.smithy.model.traits.SinceTrait$Provider software.amazon.smithy.model.traits.SparseTrait$Provider software.amazon.smithy.model.traits.StreamingTrait$Provider diff --git a/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator b/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator index 4b76f019461..1cd008b886a 100644 --- a/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator +++ b/smithy-model/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator @@ -44,6 +44,7 @@ software.amazon.smithy.model.validation.validators.ServiceAuthDefinitionsValidat software.amazon.smithy.model.validation.validators.ServiceBoundResourceOperationValidator software.amazon.smithy.model.validation.validators.ServiceValidator software.amazon.smithy.model.validation.validators.SetValidator +software.amazon.smithy.model.validation.validators.ShapeExamplesTraitValidator software.amazon.smithy.model.validation.validators.ShapeIdConflictValidator software.amazon.smithy.model.validation.validators.ShapeRecursionValidator software.amazon.smithy.model.validation.validators.SingleOperationBindingValidator 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 a91842c7bc9..8319d8e135f 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 @@ -770,6 +770,22 @@ string pattern ) structure required {} +/// Defines values which are specifically allowed and/or disallowed for a shape. +@trait( + selector: ":test(number, string, blob, structure, list, map, member)" +) +structure shapeExamples { + allowed: ShapeExampleList + disallowed: ShapeExampleList +} + +@private +@length(min: 1) +@sparse +list ShapeExampleList { + member: Document +} + /// Configures a structure member's resource property mapping behavior. @trait( selector: "structure > member" diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/traits/ShapeExamplesTraitTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/traits/ShapeExamplesTraitTest.java new file mode 100644 index 00000000000..97a8e37c2a5 --- /dev/null +++ b/smithy-model/src/test/java/software/amazon/smithy/model/traits/ShapeExamplesTraitTest.java @@ -0,0 +1,83 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package software.amazon.smithy.model.traits; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.instanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import software.amazon.smithy.model.SourceException; +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.node.ObjectNode; +import software.amazon.smithy.model.shapes.ShapeId; + +public class ShapeExamplesTraitTest { + @ParameterizedTest + @MethodSource("nodeValues") + public void loadsTrait(ObjectNode node) { + TraitFactory provider = TraitFactory.createServiceFactory(); + + Optional trait = provider.createTrait( + ShapeId.from("smithy.api#shapeExamples"), + ShapeId.from("ns.qux#foo"), + node); + assertTrue(trait.isPresent()); + assertThat(trait.get(), instanceOf(ShapeExamplesTrait.class)); + ShapeExamplesTrait shapeExamplesTrait = (ShapeExamplesTrait) trait.get(); + + assertThat(shapeExamplesTrait.toNode(), equalTo(node)); + assertThat(shapeExamplesTrait.toBuilder().build(), equalTo(shapeExamplesTrait)); + } + + public static List nodeValues() { + return Arrays.asList( + Node.objectNode() + .withMember("allowed", Node.fromStrings("a")) + .withMember("disallowed", Node.fromStrings("b")), + Node.objectNode() + .withMember("disallowed", Node.fromStrings("b")), + Node.objectNode() + .withMember("allowed", Node.fromStrings("a"))); + } + + @Test + public void requiresOneOfAllowedOrDisallowed() { + Assertions.assertThrows(SourceException.class, () -> { + TraitFactory provider = TraitFactory.createServiceFactory(); + ObjectNode node = Node.objectNode(); + provider.createTrait(ShapeId.from("smithy.api#shapeExamples"), ShapeId.from("ns.qux#foo"), node); + }); + } + + @Test + public void requiresNonEmptyAllowedListIfDefined() { + Assertions.assertThrows(SourceException.class, () -> { + TraitFactory provider = TraitFactory.createServiceFactory(); + ObjectNode node = Node.objectNode() + .withMember("allowed", Node.arrayNode()) + .withMember("disallowed", Node.fromStrings("b")); + provider.createTrait(ShapeId.from("smithy.api#shapeExamples"), ShapeId.from("ns.qux#foo"), node); + }); + } + + @Test + public void requiresNonEmptyDisallowedListIfDefined() { + Assertions.assertThrows(SourceException.class, () -> { + TraitFactory provider = TraitFactory.createServiceFactory(); + ObjectNode node = Node.objectNode() + .withMember("allowed", Node.fromStrings("a")) + .withMember("disallowed", Node.arrayNode()); + provider.createTrait(ShapeId.from("smithy.api#shapeExamples"), ShapeId.from("ns.qux#foo"), node); + }); + } +} diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java index f2fc4fb3447..d1fee55e101 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java @@ -741,6 +741,18 @@ public static Collection requiredBase64BlobValueData() { // base64 encoded value without padding {"ns.foo#Blob1", "\"Zg\"", null}, + + // Member validation + {"ns.foo#Structure2", "{\"d\": \"Zg==\"}", null}, + {"ns.foo#Structure2", + "{\"d\": \"Zm9vbw==\"}", + new String[] { + "d: Value provided for `ns.foo#Structure2$d` must have no more than 3 bytes, but the provided value has 4 bytes"}}, + {"ns.foo#Structure2", + "{\"d\": \"{}\"}", + new String[] { + "d: Blob value must be a valid base64 string" + }}, }); } } diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCaseTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCaseTest.java index 05da96569e1..3781e9b4167 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCaseTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCaseTest.java @@ -129,13 +129,13 @@ public void newlinesAreBetweenEventsWhenFormatting() { + "\n" + "Did not match the following events\n" + "----------------------------------\n" - + "[DANGER] foo.baz#Bar: a | FooBar N/A:0:0\n" - + "[DANGER] foo.baz#Bar: b | FooBar N/A:0:0\n" + + "[DANGER] foo.baz#Bar: a | FooBar\n" + + "[DANGER] foo.baz#Bar: b | FooBar\n" + "\n" + "\n" + "Encountered unexpected events\n" + "-----------------------------\n" - + "[DANGER] foo.baz#Bar: a | FooBar N/A:0:0\n" - + "[DANGER] foo.baz#Bar: b | FooBar N/A:0:0\n\n")); + + "[DANGER] foo.baz#Bar: a | FooBar\n" + + "[DANGER] foo.baz#Bar: b | FooBar\n\n")); } } diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/shape-examples-trait.errors b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/shape-examples-trait.errors new file mode 100644 index 00000000000..36161aac64d --- /dev/null +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/shape-examples-trait.errors @@ -0,0 +1,281 @@ +[ERROR] smithy.example#ConflictingExamplesByte: Allowed shape example `0`: Value provided for `smithy.example#ConflictingExamplesByte` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesByte: Allowed shape example `4`: Value provided for `smithy.example#ConflictingExamplesByte` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesByte: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesByte: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesByte: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesShort: Allowed shape example `0`: Value provided for `smithy.example#ConflictingExamplesShort` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesShort: Allowed shape example `4`: Value provided for `smithy.example#ConflictingExamplesShort` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesShort: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesShort: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesShort: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesInteger: Allowed shape example `0`: Value provided for `smithy.example#ConflictingExamplesInteger` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesInteger: Allowed shape example `4`: Value provided for `smithy.example#ConflictingExamplesInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesInteger: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesInteger: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesInteger: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesLong: Allowed shape example `0`: Value provided for `smithy.example#ConflictingExamplesLong` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesLong: Allowed shape example `4`: Value provided for `smithy.example#ConflictingExamplesLong` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesLong: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesLong: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesLong: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesFloat: Allowed shape example `0.0`: Value provided for `smithy.example#ConflictingExamplesFloat` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesFloat: Allowed shape example `4.0`: Value provided for `smithy.example#ConflictingExamplesFloat` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesFloat: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesFloat: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesFloat: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesDouble: Allowed shape example `0.0`: Value provided for `smithy.example#ConflictingExamplesDouble` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesDouble: Allowed shape example `4.0`: Value provided for `smithy.example#ConflictingExamplesDouble` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesDouble: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesDouble: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesDouble: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesBigInteger: Allowed shape example `0`: Value provided for `smithy.example#ConflictingExamplesBigInteger` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesBigInteger: Allowed shape example `4`: Value provided for `smithy.example#ConflictingExamplesBigInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesBigInteger: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesBigInteger: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesBigInteger: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesBigDecimal: Allowed shape example `0.0`: Value provided for `smithy.example#ConflictingExamplesBigDecimal` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesBigDecimal: Allowed shape example `4.0`: Value provided for `smithy.example#ConflictingExamplesBigDecimal` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#ConflictingExamplesBigDecimal: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesBigDecimal: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesBigDecimal: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesString: Allowed shape example `""`: String value provided for `smithy.example#ConflictingExamplesString` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesString: Allowed shape example `""`: String value provided for `smithy.example#ConflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesString: Allowed shape example `"b"`: String value provided for `smithy.example#ConflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#ConflictingExamplesString: Allowed shape example `"ab"`: String value provided for `smithy.example#ConflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#ConflictingExamplesString: Allowed shape example `"ba"`: String value provided for `smithy.example#ConflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#ConflictingExamplesString: Allowed shape example `"aaaa"`: String value provided for `smithy.example#ConflictingExamplesString` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.4 +[ERROR] smithy.example#ConflictingExamplesString: Disallowed shape example `"a"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesString: Disallowed shape example `"aa"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesString: Disallowed shape example `"aaa"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesBlob: Allowed shape example `""`: Value provided for `smithy.example#ConflictingExamplesBlob` must have at least 1 bytes, but the provided value only has 0 bytes | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesBlob: Allowed shape example `"{}"`: Blob value must be a valid base64 string | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#ConflictingExamplesBlob: Allowed shape example `"YWFhYQ=="`: Value provided for `smithy.example#ConflictingExamplesBlob` must have no more than 3 bytes, but the provided value has 4 bytes | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#ConflictingExamplesBlob: Disallowed shape example `"YQ=="` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesBlob: Disallowed shape example `"YWE="` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesBlob: Disallowed shape example `"YWFh"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesStructure: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#ConflictingExamplesStructure$a` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesStructure: Allowed shape example `{"a":"bbbb"}`.a: String value provided for `smithy.example#ConflictingExamplesStructure$a` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#ConflictingExamplesStructure: Allowed shape example `{}`: Missing required structure member `a` for `smithy.example#ConflictingExamplesStructure` | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#ConflictingExamplesStructure: Allowed shape example `{"a":null}`.a: Required structure member `a` for `smithy.example#ConflictingExamplesStructure` cannot be null | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#ConflictingExamplesStructure: Disallowed shape example `{"a":"b"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesStructure: Disallowed shape example `{"a":"bb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesStructure: Disallowed shape example `{"a":"bbb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesList: Allowed shape example `[]`: Value provided for `smithy.example#ConflictingExamplesList` must have at least 1 elements, but the provided value only has 0 elements | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesList: Allowed shape example `[""]`.0: String value provided for `smithy.example#ConflictingExamplesList$member` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#ConflictingExamplesList: Allowed shape example `["aaaa"]`.0: String value provided for `smithy.example#ConflictingExamplesList$member` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#ConflictingExamplesList: Allowed shape example `["a","a","a","a"]`: Value provided for `smithy.example#ConflictingExamplesList` must have no more than 3 elements, but the provided value has 4 elements | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#ConflictingExamplesList: Disallowed shape example `["a"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesList: Disallowed shape example `["a","aa"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#ConflictingExamplesList: Disallowed shape example `["a","aa","aaa"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#ConflictingExamplesMap: Allowed shape example `{"":""}`.: String value provided for `smithy.example#ConflictingExamplesMap$value` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesMap: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#ConflictingExamplesMap$value` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#ConflictingExamplesMap: Disallowed shape example `{"a":"bbb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#ConflictingExamplesMap: Disallowed shape example `{"a":"b","bbb":"aaa"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesByte: Allowed shape example `null`: Required structure member `conflictingExamplesByte` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesByte: Allowed shape example `0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesByte` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesByte: Allowed shape example `4`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesByte` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesByte: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesByte: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesByte: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesShort: Allowed shape example `null`: Required structure member `conflictingExamplesShort` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesShort: Allowed shape example `0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesShort` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesShort: Allowed shape example `4`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesShort` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesShort: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesShort: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesShort: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesInteger: Allowed shape example `null`: Required structure member `conflictingExamplesInteger` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesInteger: Allowed shape example `0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesInteger` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesInteger: Allowed shape example `4`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesLong: Allowed shape example `null`: Required structure member `conflictingExamplesLong` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesLong: Allowed shape example `0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesLong` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesLong: Allowed shape example `4`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesLong` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesLong: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesLong: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesLong: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesFloat: Allowed shape example `null`: Required structure member `conflictingExamplesFloat` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesFloat: Allowed shape example `0.0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesFloat` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesFloat: Allowed shape example `4.0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesFloat` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDouble: Allowed shape example `null`: Required structure member `conflictingExamplesDouble` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDouble: Allowed shape example `0.0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesDouble` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDouble: Allowed shape example `4.0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesDouble` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigInteger: Allowed shape example `null`: Required structure member `conflictingExamplesBigInteger` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigInteger: Allowed shape example `0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesBigInteger` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigInteger: Allowed shape example `4`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesBigInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal: Allowed shape example `null`: Required structure member `conflictingExamplesBigDecimal` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal: Allowed shape example `0.0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.1.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal: Allowed shape example `4.0`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.2.Member.InvalidRange +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `null`: Required structure member `conflictingExamplesString` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `""`: String value provided for `smithy.example#DirectMembersStructure$conflictingExamplesString` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `""`: String value provided for `smithy.example#DirectMembersStructure$conflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `"b"`: String value provided for `smithy.example#DirectMembersStructure$conflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `"ab"`: String value provided for `smithy.example#DirectMembersStructure$conflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `"ba"`: String value provided for `smithy.example#DirectMembersStructure$conflictingExamplesString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.4 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Allowed shape example `"aaaa"`: String value provided for `smithy.example#DirectMembersStructure$conflictingExamplesString` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.5 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Disallowed shape example `"a"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Disallowed shape example `"aa"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesString: Disallowed shape example `"aaa"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Allowed shape example `null`: Required structure member `conflictingExamplesBlob` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Allowed shape example `""`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesBlob` must have at least 1 bytes, but the provided value only has 0 bytes | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Allowed shape example `"{}"`: Blob value must be a valid base64 string | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Allowed shape example `"YWFhYQ=="`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesBlob` must have no more than 3 bytes, but the provided value has 4 bytes | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `"YQ=="` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `"YWE="` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `"YWFh"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Allowed shape example `null`: Required structure member `conflictingExamplesStructure` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#TestStructure$a` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{"a":"bbbbb"}`.a: String value provided for `smithy.example#TestStructure$a` must be <= 3 characters, but the provided value is 5 characters. | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{}`: Missing required structure member `a` for `smithy.example#TestStructure` | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{"a":null}`.a: Required structure member `a` for `smithy.example#TestStructure` cannot be null | ShapeExamplesTrait.allowed.4 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `{"a":"b"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `{"a":"bb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `{"a":"bbb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Allowed shape example `null`: Required structure member `conflictingExamplesList` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Allowed shape example `[]`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesList` must have at least 1 elements, but the provided value only has 0 elements | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Allowed shape example `[""]`.0: String value provided for `smithy.example#TestList$member` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Allowed shape example `["aaaa"]`.0: String value provided for `smithy.example#TestList$member` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Allowed shape example `["a","a","a","a"]`: Value provided for `smithy.example#DirectMembersStructure$conflictingExamplesList` must have no more than 3 elements, but the provided value has 4 elements | ShapeExamplesTrait.allowed.4 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Disallowed shape example `["a"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Disallowed shape example `["a","aa"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesList: Disallowed shape example `["a","aa","aaa"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Allowed shape example `null`: Required structure member `conflictingExamplesMap` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"":""}`.: String value provided for `smithy.example#TestMap$value` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#TestMap$value` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Disallowed shape example `{"a":"bbb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Disallowed shape example `{"a":"b","bbb":"aaa"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBoolean: Allowed shape example `null`: Required structure member `conflictingExamplesBoolean` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBoolean: Disallowed shape example `true` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesBoolean: Disallowed shape example `false` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesTimestamp: Allowed shape example `null`: Required structure member `conflictingExamplesTimestamp` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDocument: Allowed shape example `null`: Required structure member `conflictingExamplesDocument` for `smithy.example#DirectMembersStructure` cannot be null | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `true` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `"foo"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `123` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `{}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `[]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.4 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesByte: Allowed shape example `0`: Value provided for `smithy.example#TestByte` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesByte: Allowed shape example `4`: Value provided for `smithy.example#TestByte` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesByte: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesByte: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesByte: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesByte: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesShort: Allowed shape example `0`: Value provided for `smithy.example#TestShort` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesShort: Allowed shape example `4`: Value provided for `smithy.example#TestShort` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesShort: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesShort: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesShort: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesShort: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesInteger: Allowed shape example `0`: Value provided for `smithy.example#TestInteger` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesInteger: Allowed shape example `4`: Value provided for `smithy.example#TestInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesInteger: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesLong: Allowed shape example `0`: Value provided for `smithy.example#TestLong` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesLong: Allowed shape example `4`: Value provided for `smithy.example#TestLong` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesLong: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesLong: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesLong: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesLong: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesFloat: Allowed shape example `0.0`: Value provided for `smithy.example#TestFloat` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesFloat: Allowed shape example `4.0`: Value provided for `smithy.example#TestFloat` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesFloat: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDouble: Allowed shape example `0.0`: Value provided for `smithy.example#TestDouble` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDouble: Allowed shape example `4.0`: Value provided for `smithy.example#TestDouble` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDouble: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigInteger: Allowed shape example `0`: Value provided for `smithy.example#TestBigInteger` must be greater than or equal to 1, but found 0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigInteger: Allowed shape example `4`: Value provided for `smithy.example#TestBigInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `1` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `2` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigInteger: Disallowed shape example `3` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigDecimal: Allowed shape example `0.0`: Value provided for `smithy.example#TestBigDecimal` must be greater than or equal to 1, but found 0.0 | ShapeExamplesTrait.allowed.0.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigDecimal: Allowed shape example `4.0`: Value provided for `smithy.example#TestBigDecimal` must be less than or equal to 3, but found 4.0 | ShapeExamplesTrait.allowed.1.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `1.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `2.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBigDecimal: Disallowed shape example `3.0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Allowed shape example `""`: String value provided for `smithy.example#TestString` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Allowed shape example `""`: String value provided for `smithy.example#TestString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Allowed shape example `"b"`: String value provided for `smithy.example#TestString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Allowed shape example `"ab"`: String value provided for `smithy.example#TestString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Allowed shape example `"ba"`: String value provided for `smithy.example#TestString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Allowed shape example `"aaaa"`: String value provided for `smithy.example#TestString` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.4 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Disallowed shape example `"a"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Disallowed shape example `"aa"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesString: Disallowed shape example `"aaa"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Allowed shape example `""`: Value provided for `smithy.example#TestBlob` must have at least 1 bytes, but the provided value only has 0 bytes | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Allowed shape example `"{}"`: Blob value must be a valid base64 string | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Allowed shape example `"YWFhYQ=="`: Value provided for `smithy.example#TestBlob` must have no more than 3 bytes, but the provided value has 4 bytes | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `"YQ=="` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `"YWE="` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesBlob: Disallowed shape example `"YWFh"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#TestStructure$a` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{"a":"bbbbb"}`.a: String value provided for `smithy.example#TestStructure$a` must be <= 3 characters, but the provided value is 5 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{}`: Missing required structure member `a` for `smithy.example#TestStructure` | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Allowed shape example `{"a":null}`.a: Required structure member `a` for `smithy.example#TestStructure` cannot be null | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `{"a":"b"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `{"a":"bb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesStructure: Disallowed shape example `{"a":"bbb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesList: Allowed shape example `[""]`.0: String value provided for `smithy.example#TestList$member` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesList: Allowed shape example `["aaaa"]`.0: String value provided for `smithy.example#TestList$member` must be <= 3 characters, but the provided value is 4 characters. | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesList: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesList: Disallowed shape example `["a"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesList: Disallowed shape example `["a","aa"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesList: Disallowed shape example `["a","aa","aaa"]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"":""}`.: String value provided for `smithy.example#TestMap$value` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#TestMap$value` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Disallowed shape example `{"a":"bbb"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Disallowed shape example `{"a":"b","bbb":"aaa"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesTimestamp: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesEnum: Allowed shape example `"B"`: String value provided for `smithy.example#TestEnum` must be one of the following values: `A` | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesEnum: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesEnum: Disallowed shape example `"A"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesIntEnum: Allowed shape example `1`: Integer value provided for `smithy.example#TestIntEnum` must be one of the following values: `0`, but found 1 | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesIntEnum: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesIntEnum: Disallowed shape example `0` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Allowed shape example `{}`: union values must contain a value for exactly one member | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#TestString` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Allowed shape example `{"a":""}`.a: String value provided for `smithy.example#TestString` must match regular expression: ^a+$ | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Allowed shape example `{"b":4}`.b: Value provided for `smithy.example#TestInteger` must be less than or equal to 3, but found 4 | ShapeExamplesTrait.allowed.2.Target.InvalidRange +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Disallowed shape example `{"a":"a"}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesUnion: Disallowed shape example `{"b":1}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `null` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `true` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.1 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `"foo"` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.2 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `123` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `{}` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.4 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesDocument: Disallowed shape example `[]` passed all validations when it shouldn't have | ShapeExamplesTrait.disallowed.5 +[WARNING] smithy.example#WarningGeneratingExamplesStructure: Allowed shape example `{"a":"a","b":"b"}`: Member `b` does not exist in `smithy.example#WarningGeneratingExamplesStructure` | ShapeExamplesTrait.allowed.0.UnknownMember.smithy.example#WarningGeneratingExamplesStructure.b +[WARNING] smithy.example#WarningGeneratingExamplesStructure: Disallowed shape example `{"a":"","b":"b"}`: Member `b` does not exist in `smithy.example#WarningGeneratingExamplesStructure` | ShapeExamplesTrait.disallowed.0.UnknownMember.smithy.example#WarningGeneratingExamplesStructure.b +[ERROR] smithy.example#ConflictingExamplesMap: Allowed shape example `{"":""}`. (map-key): String value provided for `smithy.example#ConflictingExamplesMap$key` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#ConflictingExamplesMap: Allowed shape example `{"":"a"}`. (map-key): String value provided for `smithy.example#ConflictingExamplesMap$key` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.2 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"":""}`. (map-key): String value provided for `smithy.example#TestMap$key` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.1 +[ERROR] smithy.example#DirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"":"a"}`. (map-key): String value provided for `smithy.example#TestMap$key` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.3 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"":""}`. (map-key): String value provided for `smithy.example#TestMap$key` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.0 +[ERROR] smithy.example#IndirectMembersStructure$conflictingExamplesMap: Allowed shape example `{"":"a"}`. (map-key): String value provided for `smithy.example#TestMap$key` must be >= 1 characters, but the provided value is only 0 characters. | ShapeExamplesTrait.allowed.2 \ No newline at end of file diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/shape-examples-trait.smithy b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/shape-examples-trait.smithy new file mode 100644 index 00000000000..9ca531c45fe --- /dev/null +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/shape-examples-trait.smithy @@ -0,0 +1,1501 @@ +$version: "2" + +namespace smithy.example + +@shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] +}) +@range(min: 1, max: 3) +byte ValidExamplesByte + +@shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] +}) +@range(min: 1, max: 3) +byte ConflictingExamplesByte + +@shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] +}) +@range(min: 1, max: 3) +short ValidExamplesShort + +@shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] +}) +@range(min: 1, max: 3) +short ConflictingExamplesShort + +@shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] +}) +@range(min: 1, max: 3) +integer ValidExamplesInteger + +@shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] +}) +@range(min: 1, max: 3) +integer ConflictingExamplesInteger + +@shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] +}) +@range(min: 1, max: 3) +long ValidExamplesLong + +@shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] +}) +@range(min: 1, max: 3) +long ConflictingExamplesLong + +@shapeExamples({ + allowed: [ + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + 0.0 + 4.0 + ] +}) +@range(min: 1, max: 3) +float ValidExamplesFloat + +@shapeExamples({ + allowed: [ + 0.0 + 4.0 + ] + disallowed: [ + 1.0 + 2.0 + 3.0 + ] +}) +@range(min: 1, max: 3) +float ConflictingExamplesFloat + +@shapeExamples({ + allowed: [ + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + 0.0 + 4.0 + ] +}) +@range(min: 1, max: 3) +double ValidExamplesDouble + +@shapeExamples({ + allowed: [ + 0.0 + 4.0 + ] + disallowed: [ + 1.0 + 2.0 + 3.0 + ] +}) +@range(min: 1, max: 3) +double ConflictingExamplesDouble + +@shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] +}) +@range(min: 1, max: 3) +bigInteger ValidExamplesBigInteger + +@shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] +}) +@range(min: 1, max: 3) +bigInteger ConflictingExamplesBigInteger + +@shapeExamples({ + allowed: [ + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + 0.0 + 4.0 + ] +}) +@range(min: 1, max: 3) +bigDecimal ValidExamplesBigDecimal + +@shapeExamples({ + allowed: [ + 0.0 + 4.0 + ] + disallowed: [ + 1.0 + 2.0 + 3.0 + ] +}) +@range(min: 1, max: 3) +bigDecimal ConflictingExamplesBigDecimal + +@shapeExamples({ + allowed: [ + "a" + "aa" + "aaa" + ] + disallowed: [ + "" + "b" + "ab" + "ba" + "aaaa" + ] +}) +@length(min: 1, max: 3) +@pattern("^a+$") +string ValidExamplesString + +@shapeExamples({ + allowed: [ + "" + "b" + "ab" + "ba" + "aaaa" + ] + disallowed: [ + "a" + "aa" + "aaa" + ] +}) +@length(min: 1, max: 3) +@pattern("^a+$") +string ConflictingExamplesString + +@shapeExamples({ + allowed: [ + "YQ==" + "YWE=" + "YWFh" + ] + disallowed: [ + "" + "{}" + "YWFhYQ==" + ] +}) +@length(min: 1, max: 3) +blob ValidExamplesBlob + +@shapeExamples({ + allowed: [ + "" + "{}" + "YWFhYQ==" + ] + disallowed: [ + "YQ==" + "YWE=" + "YWFh" + ] +}) +@length(min: 1, max: 3) +blob ConflictingExamplesBlob + +@shapeExamples({ + allowed: [ + { a: "b" } + { a: "bb" } + { a: "bbb" } + ] + disallowed: [ + { a: "" } + { a: "bbbbb" } + { } + { a: null } + ] +}) +structure ValidExamplesStructure { + @length(min: 1, max: 3) + @required + a: String +} + +@shapeExamples({ + allowed: [ + { a: "" } + { a: "bbbb" } + { } + { a: null } + ] + disallowed: [ + { a: "b" } + { a: "bb" } + { a: "bbb" } + ] +}) +structure ConflictingExamplesStructure { + @length(min: 1, max: 3) + @required + a: String +} + +@shapeExamples({ + allowed: [ + ["a"] + ["a", "aa"] + ["a", "aa", "aaa"] + ] + disallowed: [ + [] + [""] + ["aaaa"] + ["a", "a", "a", "a"] + ] +}) +@length(min: 1, max: 3) +list ValidExamplesList { + @length(min: 1, max: 3) + member: String +} + +@shapeExamples({ + allowed: [ + [] + [""] + ["aaaa"] + ["a", "a", "a", "a"] + ] + disallowed: [ + ["a"] + ["a", "aa"] + ["a", "aa", "aaa"] + ] +}) +@length(min: 1, max: 3) +list ConflictingExamplesList { + @length(min: 1, max: 3) + member: String +} + +@shapeExamples({ + allowed: [ + { "a": "bbb" } + { "a": "b", "bbb": "aaa" } + ] + disallowed: [ + { "": "" } + { "a": "" } + { "": "a" } + ] +}) +@length(min: 1, max: 3) +map ValidExamplesMap { + @length(min: 1, max: 3) + key: String + + @length(min: 1, max: 3) + value: String +} + +@shapeExamples({ + allowed: [ + { "": "" } + { "a": "" } + { "": "a" } + ] + disallowed: [ + { "a": "bbb" } + { "a": "b", "bbb": "aaa" } + ] +}) +@length(min: 1, max: 3) +map ConflictingExamplesMap { + @length(min: 1, max: 3) + key: String + + @length(min: 1, max: 3) + value: String +} + +structure DirectMembersStructure { + + @shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + null + 0 + 4 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesByte: Byte + + @shapeExamples({ + allowed: [ + null + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesByte: Byte + + @shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + null + 0 + 4 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesShort: Short + + @shapeExamples({ + allowed: [ + null + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesShort: Short + + + @shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + null + 0 + 4 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesInteger: Integer + + @shapeExamples({ + allowed: [ + null + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesInteger: Integer + + @shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + null + 0 + 4 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesLong: Long + + @shapeExamples({ + allowed: [ + null + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesLong: Long + + @shapeExamples({ + allowed: [ + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + null + 0.0 + 4.0 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesFloat: Float + + @shapeExamples({ + allowed: [ + null + 0.0 + 4.0 + ] + disallowed: [ + 1.0 + 2.0 + 3.0 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesFloat: Float + + @shapeExamples({ + allowed: [ + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + null + 0.0 + 4.0 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesDouble: Double + + @shapeExamples({ + allowed: [ + null + 0.0 + 4.0 + ] + disallowed: [ + 1.0 + 2.0 + 3.0 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesDouble: Double + + @shapeExamples({ + allowed: [ + 1 + 2 + 3 + ] + disallowed: [ + null + 0 + 4 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesBigInteger: BigInteger + + @shapeExamples({ + allowed: [ + null + 0 + 4 + ] + disallowed: [ + 1 + 2 + 3 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesBigInteger: BigInteger + + @shapeExamples({ + allowed: [ + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + null + 0.0 + 4.0 + ] + }) + @range(min: 1, max: 3) + @required + validExamplesBigDecimal: BigDecimal + + @shapeExamples({ + allowed: [ + null + 0.0 + 4.0 + ] + disallowed: [ + 1.0 + 2.0 + 3.0 + ] + }) + @range(min: 1, max: 3) + @required + conflictingExamplesBigDecimal: BigDecimal + + @shapeExamples({ + allowed: [ + "a" + "aa" + "aaa" + ] + disallowed: [ + null + "" + "b" + "ab" + "ba" + "aaaa" + ] + }) + @length(min: 1, max: 3) + @pattern("^a+$") + @required + validExamplesString: String + + @shapeExamples({ + allowed: [ + null + "" + "b" + "ab" + "ba" + "aaaa" + ] + disallowed: [ + "a" + "aa" + "aaa" + ] + }) + @length(min: 1, max: 3) + @pattern("^a+$") + @required + conflictingExamplesString: String + + @shapeExamples({ + allowed: [ + "YQ==" + "YWE=" + "YWFh" + ] + disallowed: [ + null + "" + "{}" + "YWFhYQ==" + ] + }) + @length(min: 1, max: 3) + @required + validExamplesBlob: Blob + + @shapeExamples({ + allowed: [ + null + "" + "{}" + "YWFhYQ==" + ] + disallowed: [ + "YQ==" + "YWE=" + "YWFh" + ] + }) + @length(min: 1, max: 3) + @required + conflictingExamplesBlob: Blob + + @shapeExamples({ + allowed: [ + { a: "b" } + { a: "bb" } + { a: "bbb" } + ] + disallowed: [ + null + { a: "" } + { a: "bbbbb" } + { } + { a: null } + ] + }) + @required + validExamplesStructure: TestStructure + + @shapeExamples({ + allowed: [ + null + { a: "" } + { a: "bbbbb" } + { } + { a: null } + ] + disallowed: [ + { a: "b" } + { a: "bb" } + { a: "bbb" } + ] + }) + @required + conflictingExamplesStructure: TestStructure + + @shapeExamples({ + allowed: [ + ["a"] + ["a", "aa"] + ["a", "aa", "aaa"] + ] + disallowed: [ + null + [] + [""] + ["aaaa"] + ["a", "a", "a", "a"] + ] + }) + @length(min: 1, max: 3) + @required + validExamplesList: TestList + + @shapeExamples({ + allowed: [ + null + [] + [""] + ["aaaa"] + ["a", "a", "a", "a"] + ] + disallowed: [ + ["a"] + ["a", "aa"] + ["a", "aa", "aaa"] + ] + }) + @length(min: 1, max: 3) + @required + conflictingExamplesList: TestList + + @shapeExamples({ + allowed: [ + { "a": "bbb" } + { "a": "b", "bbb": "aaa" } + ] + disallowed: [ + null + { "": "" } + { "a": "" } + { "": "a" } + ] + }) + @required + validExamplesMap: TestMap + + @shapeExamples({ + allowed: [ + null + { "": "" } + { "a": "" } + { "": "a" } + ] + disallowed: [ + { "a": "bbb" } + { "a": "b", "bbb": "aaa" } + ] + }) + @required + conflictingExamplesMap: TestMap + + @shapeExamples({ + allowed: [ + true + false + ] + disallowed: [ + null + ] + }) + @required + validExamplesBoolean: Boolean + + @shapeExamples({ + allowed: [ + null + ] + disallowed: [ + true + false + ] + }) + @required + conflictingExamplesBoolean: Boolean + + @shapeExamples({ + disallowed: [ + null + ] + }) + @required + validExamplesTimestamp: Timestamp + + @shapeExamples({ + allowed: [ + null + ] + }) + @required + conflictingExamplesTimestamp: Timestamp + + @shapeExamples({ + allowed: [ + true + "foo" + 123 + {} + [] + ] + disallowed: [ + null + ] + }) + @required + validExamplesDocument: Document + + @shapeExamples({ + allowed: [ + null + ] + disallowed: [ + true + "foo" + 123 + {} + [] + ] + }) + @required + conflictingExamplesDocument: Document + +} + +structure IndirectMembersStructure { + + @shapeExamples({ + allowed: [ + null + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] + }) + validExamplesByte: TestByte + + @shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + null + 1 + 2 + 3 + ] + }) + conflictingExamplesByte: TestByte + + @shapeExamples({ + allowed: [ + null + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] + }) + validExamplesShort: TestShort + + @shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + null + 1 + 2 + 3 + ] + }) + conflictingExamplesShort: TestShort + + + @shapeExamples({ + allowed: [ + null + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] + }) + validExamplesInteger: TestInteger + + @shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + null + 1 + 2 + 3 + ] + }) + conflictingExamplesInteger: TestInteger + + @shapeExamples({ + allowed: [ + null + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] + }) + validExamplesLong: TestLong + + @shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + null + 1 + 2 + 3 + ] + }) + conflictingExamplesLong: TestLong + + @shapeExamples({ + allowed: [ + null + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + 0.0 + 4.0 + ] + }) + validExamplesFloat: TestFloat + + @shapeExamples({ + allowed: [ + 0.0 + 4.0 + ] + disallowed: [ + null + 1.0 + 2.0 + 3.0 + ] + }) + conflictingExamplesFloat: TestFloat + + @shapeExamples({ + allowed: [ + null + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + 0.0 + 4.0 + ] + }) + validExamplesDouble: TestDouble + + @shapeExamples({ + allowed: [ + 0.0 + 4.0 + ] + disallowed: [ + null + 1.0 + 2.0 + 3.0 + ] + }) + conflictingExamplesDouble: TestDouble + + @shapeExamples({ + allowed: [ + null + 1 + 2 + 3 + ] + disallowed: [ + 0 + 4 + ] + }) + validExamplesBigInteger: TestBigInteger + + @shapeExamples({ + allowed: [ + 0 + 4 + ] + disallowed: [ + null + 1 + 2 + 3 + ] + }) + conflictingExamplesBigInteger: TestBigInteger + + @shapeExamples({ + allowed: [ + null + 1.0 + 2.0 + 3.0 + ] + disallowed: [ + 0.0 + 4.0 + ] + }) + validExamplesBigDecimal: TestBigDecimal + + @shapeExamples({ + allowed: [ + 0.0 + 4.0 + ] + disallowed: [ + null + 1.0 + 2.0 + 3.0 + ] + }) + conflictingExamplesBigDecimal: TestBigDecimal + + @shapeExamples({ + allowed: [ + null + "a" + "aa" + "aaa" + ] + disallowed: [ + "" + "b" + "ab" + "ba" + "aaaa" + ] + }) + validExamplesString: TestString + + @shapeExamples({ + allowed: [ + "" + "b" + "ab" + "ba" + "aaaa" + ] + disallowed: [ + null + "a" + "aa" + "aaa" + ] + }) + conflictingExamplesString: TestString + + @shapeExamples({ + allowed: [ + null + "YQ==" + "YWE=" + "YWFh" + ] + disallowed: [ + "" + "{}" + "YWFhYQ==" + ] + }) + validExamplesBlob: TestBlob + + @shapeExamples({ + allowed: [ + "" + "{}" + "YWFhYQ==" + ] + disallowed: [ + null + "YQ==" + "YWE=" + "YWFh" + ] + }) + conflictingExamplesBlob: TestBlob + + @shapeExamples({ + allowed: [ + null + { a: "b" } + { a: "bb" } + { a: "bbb" } + ] + disallowed: [ + { a: "" } + { a: "bbbbb" } + { } + { a: null } + ] + }) + validExamplesStructure: TestStructure + + @shapeExamples({ + allowed: [ + { a: "" } + { a: "bbbbb" } + { } + { a: null } + ] + disallowed: [ + null + { a: "b" } + { a: "bb" } + { a: "bbb" } + ] + }) + conflictingExamplesStructure: TestStructure + + @shapeExamples({ + allowed: [ + null + [] + ["a"] + ["a", "aa"] + ["a", "aa", "aaa"] + ["a", "a", "a", "a"] + ] + disallowed: [ + [""] + ["aaaa"] + ] + }) + validExamplesList: TestList + + @shapeExamples({ + allowed: [ + [] + [""] + ["aaaa"] + ["a", "a", "a", "a"] + ] + disallowed: [ + null + ["a"] + ["a", "aa"] + ["a", "aa", "aaa"] + ] + }) + conflictingExamplesList: TestList + + @shapeExamples({ + allowed: [ + null + { "a": "bbb" } + { "a": "b", "bbb": "aaa" } + ] + disallowed: [ + { "": "" } + { "a": "" } + { "": "a" } + ] + }) + validExamplesMap: TestMap + + @shapeExamples({ + allowed: [ + { "": "" } + { "a": "" } + { "": "a" } + ] + disallowed: [ + null + { "a": "bbb" } + { "a": "b", "bbb": "aaa" } + ] + }) + conflictingExamplesMap: TestMap + + @shapeExamples({ + allowed: [ + null + ] + }) + validExamplesBoolean: TestBoolean + + @shapeExamples({ + allowed: [ + null + ] + }) + validExamplesTimestamp: Timestamp + + @shapeExamples({ + disallowed: [ + null + ] + }) + conflictingExamplesTimestamp: Timestamp + + @shapeExamples({ + allowed: [ + null + "A" + ] + disallowed: [ + "B" + ] + }) + validExamplesEnum: TestEnum + + @shapeExamples({ + allowed: [ + "B" + ] + disallowed: [ + null + "A" + ] + }) + conflictingExamplesEnum: TestEnum + + @shapeExamples({ + allowed: [ + null + 0 + ] + disallowed: [ + 1 + ] + }) + validExamplesIntEnum: TestIntEnum + + @shapeExamples({ + allowed: [ + 1 + ] + disallowed: [ + null + 0 + ] + }) + conflictingExamplesIntEnum: TestIntEnum + + @shapeExamples({ + allowed: [ + null + {a: "a"} + {b: 1} + ] + disallowed: [ + {} + {a: ""} + {b: 4} + ] + }) + validExamplesUnion: TestUnion + + @shapeExamples({ + allowed: [ + {} + {a: ""} + {b: 4} + ] + disallowed: [ + null + {a: "a"} + {b: 1} + ] + }) + conflictingExamplesUnion: TestUnion + + @shapeExamples({ + allowed: [ + null + true + "foo" + 123 + {} + [] + ] + }) + validExamplesDocument: Document + + @shapeExamples({ + disallowed: [ + null + true + "foo" + 123 + {} + [] + ] + }) + conflictingExamplesDocument: Document +} + +@range(min: 1, max: 3) +byte TestByte + +@range(min: 1, max: 3) +short TestShort + +@range(min: 1, max: 3) +integer TestInteger + +@range(min: 1, max: 3) +long TestLong + +@range(min: 1, max: 3) +float TestFloat + +@range(min: 1, max: 3) +double TestExamplesDouble + +@range(min: 1, max: 3) +double TestDouble + +@range(min: 1, max: 3) +bigInteger TestBigInteger + +@range(min: 1, max: 3) +bigDecimal TestBigDecimal + +@length(min: 1, max: 3) +@pattern("^a+$") +string TestString + +@length(min: 1, max: 3) +blob TestBlob + +structure TestStructure { + @length(min: 1, max: 3) + @required + a: String +} + +list TestList { + @length(min: 1, max: 3) + member: String +} + +map TestMap { + @length(min: 1, max: 3) + key: String + + @length(min: 1, max: 3) + value: String +} + +boolean TestBoolean + +timestamp TestTimestamp + +enum TestEnum { + A +} + +intEnum TestIntEnum { + A = 0 +} + +union TestUnion { + a: TestString + b: TestInteger +} + +document TestDocument + +@shapeExamples({ + allowed: [ + {a: "a", b: "b"} + ] + disallowed: [ + {a: "", b: "b"} + ] +}) +structure WarningGeneratingExamplesStructure { + @length(min: 1) + @required + a: String +} \ No newline at end of file diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/validation/node-validator.json b/smithy-model/src/test/resources/software/amazon/smithy/model/validation/node-validator.json index 753bc144e57..10656348397 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/validation/node-validator.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/validation/node-validator.json @@ -295,6 +295,15 @@ "min": 10 } } + }, + "d": { + "target": "smithy.api#Blob", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 3 + } + } } } },