diff --git a/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.api.json b/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.api.json index 077aa4cbb95..65c29dc078b 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.api.json +++ b/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.api.json @@ -142,15 +142,6 @@ "smithy.api#private": true } }, - "aws.api#StringList": { - "type": "list", - "member": { - "target": "smithy.api#String" - }, - "traits": { - "smithy.api#private": true - } - }, "aws.api#clientDiscoveredEndpoint": { "type": "structure", "members": { diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.json b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.json index 5fab963c3a5..95c12bd58a8 100644 --- a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.json +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.json @@ -4,6 +4,11 @@ "ns.foo#Service1": { "type": "service", "version": "2018-03-17", + "operations": [ + { + "target": "ns.foo#Operation" + } + ], "traits": { "aws.api#service": { "sdkId": "Some Value" diff --git a/smithy-linters/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.ValidatorService b/smithy-linters/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.ValidatorService index 6d5014d1571..cde4964fdfc 100644 --- a/smithy-linters/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.ValidatorService +++ b/smithy-linters/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.ValidatorService @@ -8,4 +8,3 @@ software.amazon.smithy.linters.ReservedWordsValidator$Provider software.amazon.smithy.linters.ShouldHaveUsedTimestampValidator$Provider software.amazon.smithy.linters.StandardOperationVerbValidator$Provider software.amazon.smithy.linters.StutteredShapeNameValidator$Provider -software.amazon.smithy.linters.UnreferencedShapeValidator$Provider diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/contains-reserved-words-validator.json b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/contains-reserved-words-validator.json index dfff5f332e8..94921507236 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/contains-reserved-words-validator.json +++ b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/contains-reserved-words-validator.json @@ -6,6 +6,21 @@ "members": { "bar": { "target": "ns.foo#String" + }, + "long": { + "target": "ns.foo#Long" + }, + "bool": { + "target": "ns.foo#Boolean" + }, + "list": { + "target": "ns.foo#List" + }, + "timestamp": { + "target": "ns.foo#UtcTimestamp" + }, + "blob": { + "target": "ns.foo#Blob" } } }, @@ -50,6 +65,9 @@ "operations": [ { "target": "ns.foo#OperationA" + }, + { + "target": "ns.foo#_OperationBaz" } ] }, diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/emit-each-selector-validator.errors b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/emit-each-selector-validator.errors index 99f917a7a72..951f6caecca 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/emit-each-selector-validator.errors +++ b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/emit-each-selector-validator.errors @@ -122,3 +122,10 @@ [ERROR] -: Error creating `EmitEachSelector` validator: Deserialization error at (/selector): unable to create software.amazon.smithy.model.selector.Selector from "service -[foo]-> *": Unable to deserialize Node using fromNode method: Syntax error at character 10 of 18, near `foo]-> *`: Expected one of the following tokens: `bound`, `collectionOperation`, `create`, `delete`, `error`, `identifier`, `input`, `instanceOperation`, `list`, `member`, `operation`, `output`, `put`, `read`, `resource`, `update`; expression `service -[foo]-> *` | Model [ERROR] -: Error creating `EmitEachSelector` validator: Deserialization error at (/selector): unable to create software.amazon.smithy.model.selector.Selector from "[foo]": Unable to deserialize Node using fromNode method: Syntax error at character 1 of 5, near `foo]`: Expected one of the following tokens: `id`, `id|member`, `id|name`, `id|namespace`, `service|version`, `trait|`; expression `[foo]` | Model [ERROR] -: Error creating `EmitEachSelector` validator: Deserialization error at (/selector): unable to create software.amazon.smithy.model.selector.Selector from "[foo=baz]": Unable to deserialize Node using fromNode method: Syntax error at character 1 of 9, near `foo=baz]`: Expected one of the following tokens: `id`, `id|member`, `id|name`, `id|namespace`, `service|version`, `trait|`; expression `[foo=baz]` | Model +[NOTE] ns.foo#Long: The long shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#Float: The float shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#Boolean: The boolean shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#Blob: The blob shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#List: The list shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#UtcTimestamp: The timestamp shape is not connected to from any service shape. | UnreferencedShape +[NOTE] other.ns#String: The string shape is not connected to from any service shape. | UnreferencedShape diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/input-output-structure-reuse.json b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/input-output-structure-reuse.json index 7043302c89c..efd31f5a336 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/input-output-structure-reuse.json +++ b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/input-output-structure-reuse.json @@ -70,9 +70,6 @@ "ns.foo#CInputOutput": { "type": "structure" }, - "ns.foo#COutputOutput": { - "type": "structure" - }, "ns.foo#D": { "type": "operation", "input": { @@ -88,9 +85,6 @@ "ns.foo#DInputOutput": { "type": "structure" }, - "ns.foo#DOutputOutput": { - "type": "structure" - }, "ns.foo#E": { "type": "operation", "output": { diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/missing-documentation-selector-test.json b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/missing-documentation-selector-test.json index c61efed5f35..d59f4093543 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/missing-documentation-selector-test.json +++ b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/missing-documentation-selector-test.json @@ -3,7 +3,21 @@ "shapes": { "ns.foo#MyService": { "type": "service", - "version": "2017-01-17" + "version": "2017-01-17", + "operations": [ + { + "target": "ns.foo#Operation" + } + ] + }, + "ns.foo#Operation": { + "type": "operation", + "input": { + "target": "ns.foo#Structure" + }, + "traits": { + "smithy.api#documentation": "operation documentation" + } }, "ns.foo#SomeList": { "type": "list", @@ -34,6 +48,18 @@ }, "bar": { "target": "ns.foo#DocString" + }, + "someList": { + "target": "ns.foo#SomeList", + "traits": { + "smithy.api#documentation": "list documentation" + } + }, + "map": { + "target": "ns.foo#Map", + "traits": { + "smithy.api#documentation": "map documentation" + } } } }, diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/unreferenced-shape-validator.errors b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/unreferenced-shape-validator.errors deleted file mode 100644 index b88cf60b20f..00000000000 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/unreferenced-shape-validator.errors +++ /dev/null @@ -1,2 +0,0 @@ -[NOTE] ns.foo#UnreferencedString: The ns.foo#UnreferencedString string shape is not connected to from any service shape. | UnreferencedShape -[NOTE] ns.foo#UnreferencedStructure: The ns.foo#UnreferencedStructure structure shape is not connected to from any service shape. | UnreferencedShape diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.errors b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.errors index d9ba5a669af..24c49ee7c88 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.errors +++ b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.errors @@ -1,8 +1,5 @@ [DANGER] ns.foo#Ignore_Me: string shape name, `Ignore_Me`, is not upper camel case | CamelCase [ERROR] -: Each element of `suppressions` must be an object. Found array. | Model [ERROR] -: Each element of `validators` must be an object. Found string. | Model -[SUPPRESSED] ns.baz#This_is_ignored_too: The ns.baz#This_is_ignored_too string shape is not connected to from any service shape. | UnreferencedShape [SUPPRESSED] ns.baz#This_is_ignored_too: string shape name, `This_is_ignored_too`, is not upper camel case | CamelCase -[SUPPRESSED] ns.foo#Ignore_Me: The ns.foo#Ignore_Me string shape is not connected to from any service shape. | UnreferencedShape -[SUPPRESSED] ns.foo#OrphanShape: The ns.foo#OrphanShape string shape is not connected to from any service shape. | UnreferencedShape [WARNING] -: Unable to locate a validator named `UnknownValidator` | UnknownValidator.UnknownValidator diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.json b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.json index 4e7fda872ad..f96f7682887 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.json +++ b/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/validator-loading-test.json @@ -16,9 +16,6 @@ { "name": "UnknownValidator" }, - { - "name": "UnreferencedShape" - }, { "name": "CamelCase" }, @@ -30,11 +27,6 @@ "UnreferencedShape" ] }, - { - "ids": [ - "UnknownValidator" - ] - }, [], { "ids": [ diff --git a/smithy-linters/src/main/java/software/amazon/smithy/linters/UnreferencedShapeValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/UnreferencedShapeValidator.java similarity index 70% rename from smithy-linters/src/main/java/software/amazon/smithy/linters/UnreferencedShapeValidator.java rename to smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/UnreferencedShapeValidator.java index 084fe3585fd..88be3668fbd 100644 --- a/smithy-linters/src/main/java/software/amazon/smithy/linters/UnreferencedShapeValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/UnreferencedShapeValidator.java @@ -13,34 +13,36 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.linters; +package software.amazon.smithy.model.validation.validators; +import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.neighbor.UnreferencedShapes; +import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.validation.AbstractValidator; import software.amazon.smithy.model.validation.ValidationEvent; -import software.amazon.smithy.model.validation.ValidatorService; /** * Adds a validation note event for each shape in the model that is not * connected to a service shape. */ public final class UnreferencedShapeValidator extends AbstractValidator { + @Override + public List validate(Model model) { + Set serviceShapes = model.shapes(ServiceShape.class) + .collect(Collectors.toSet()); - public static final class Provider extends ValidatorService.Provider { - public Provider() { - super(UnreferencedShapeValidator.class, UnreferencedShapeValidator::new); + // Do not emit validation warnings if no services are present in the model. + if (serviceShapes.isEmpty()) { + return Collections.emptyList(); } - } - @Override - public List validate(Model model) { return new UnreferencedShapes().compute(model).stream() .map(shape -> note(shape, String.format( - "The %s %s shape is not connected to from any service shape.", - shape.getId(), shape.getType()))) + "The %s shape is not connected to from any service shape.", shape.getType()))) .collect(Collectors.toList()); } } 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 4c33af19dd4..439e5b9e645 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 @@ -33,6 +33,7 @@ software.amazon.smithy.model.validation.validators.TargetValidator software.amazon.smithy.model.validation.validators.TraitConflictValidator software.amazon.smithy.model.validation.validators.TraitTargetValidator software.amazon.smithy.model.validation.validators.TraitValueValidator +software.amazon.smithy.model.validation.validators.UnreferencedShapeValidator software.amazon.smithy.model.validation.validators.UnstableFeatureValidator software.amazon.smithy.model.validation.validators.UnstableTraitValidator software.amazon.smithy.model.validation.validators.XmlNamespaceTraitValidator diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/loader/ModelAssemblerTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/loader/ModelAssemblerTest.java index 7c7be72a37f..73d5f95cd8b 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/loader/ModelAssemblerTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/loader/ModelAssemblerTest.java @@ -173,7 +173,10 @@ public void importsSymlinksDirectoryWithAllShapes() throws Exception { .addImport(getClass().getResource("main.json")) .addImport(createSymbolicLink(Paths.get(getClass().getResource("nested").toURI()), "symlink-nested")) .assemble(); - assertThat(result.getValidationEvents(), empty()); + + result.getValidationEvents().forEach(event -> { + assertThat(event.getSuppressionReason().get(), is("This shape is being tested for model assembly.")); + }); Model model = result.unwrap(); assertTrue(model.getShape(ShapeId.from("example.namespace#String")).isPresent()); assertThat(model.getShape(ShapeId.from("example.namespace#String")).get().getType(), @@ -267,7 +270,9 @@ public void importsFilesWithAllShapes() throws Exception { .addImport(Paths.get(getClass().getResource("nested").toURI())) .assemble(); - assertThat(result.getValidationEvents(), empty()); + result.getValidationEvents().forEach(event -> { + assertThat(event.getSuppressionReason().get(), is("This shape is being tested for model assembly.")); + }); Model model = result.unwrap(); assertTrue(model.getShape(ShapeId.from("example.namespace#String")).isPresent()); assertThat(model.getShape(ShapeId.from("example.namespace#String")).get().getType(), diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/host-request-validator.json b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/host-request-validator.json index 04e310ef1e9..79cb1adc740 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/host-request-validator.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/host-request-validator.json @@ -37,6 +37,9 @@ }, { "target": "ns.foo#L" + }, + { + "target": "ns.foo#M" } ] }, diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.errors b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.errors index 9283c055440..7caada896d7 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.errors +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.errors @@ -27,3 +27,5 @@ [ERROR] ns.foo#OInput$a: Members with the `httpLabel` trait must be required. | HttpLabelTrait [ERROR] ns.foo#PInput$a: The `a` structure member corresponds to a greedy label when used as the input of the `ns.foo#P` operation. This member targets (integer: `ns.foo#Integer`), but greedy labels must target string shapes. | HttpLabelTrait [ERROR] ns.foo#RInput$b: `httpHeader` binding of `x-foo` conflicts with the `httpPrefixHeaders` binding of `ns.foo#RInput$a` to ``. `httpHeader` bindings must not case-insensitively start with any `httpPrefixHeaders` bindings. | HttpPrefixHeadersTrait +[NOTE] ns.foo#BadError: The structure shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#BadErrorMultipleBindings: The structure shape is not connected to from any service shape. | UnreferencedShape diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.json b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.json index e2d12182eff..b598ebc84cd 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-request-response-validator.json @@ -52,6 +52,9 @@ }, { "target": "ns.foo#R" + }, + { + "target": "ns.foo#Q" } ] }, diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/paginated-trait-test.json b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/paginated-trait-test.json index 8d7b594e80e..76528370b3e 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/paginated-trait-test.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/paginated-trait-test.json @@ -40,6 +40,18 @@ }, { "target": "ns.foo#Invalid9" + }, + { + "target": "ns.foo#ValidNestedOutputOperation" + }, + { + "target": "ns.foo#DeeplyNestedOutputOperation" + }, + { + "target": "ns.foo#InvalidNoOutput" + }, + { + "target": "ns.foo#InvalidNestedInput" } ] }, diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/private-access.json b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/private-access.json index 9ce1422b4bf..1b3f81b38e5 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/private-access.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/private-access.json @@ -7,6 +7,9 @@ "operations": [ { "target": "smithy.private#PrivateOperation" + }, + { + "target": "smithy.example#InvalidOperation" } ] }, @@ -52,6 +55,15 @@ "members": { "valid": { "target": "smithy.private#PrivateString" + }, + "list": { + "target": "smithy.example#InvalidList" + }, + "struct": { + "target": "smithy.example#InvalidStructure" + }, + "map": { + "target": "smithy.example#InvalidMap" } }, "traits": { diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/resource-parent-validator.errors b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/resource-parent-validator.errors index 342687f89f9..4e0bcea7e19 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/resource-parent-validator.errors +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/resource-parent-validator.errors @@ -4,3 +4,6 @@ [ERROR] ns.foo#InvalidResourceBindingType: resource shape `resource` relationships must target a resource shape, but found (string: `smithy.api#String`) | Target [ERROR] ns.foo#InvalidSelfResourceBinding: A resource can appear only once in an entire service closure. This resource is illegally bound into the `ns.foo#MyService` service closure from multiple shapes: [`ns.foo#InvalidSelfResourceBinding`, `ns.foo#MyService`] | SingleResourceBinding [ERROR] ns.foo#InvalidSelfResourceBinding: Circular resource hierarchy found: ns.foo#InvalidSelfResourceBinding -> ns.foo#InvalidSelfResourceBinding | ResourceCycle +[NOTE] ns.foo#CycleA: The resource shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#CycleB: The resource shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#CycleC: The resource shape is not connected to from any service shape. | UnreferencedShape diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/target-validator.json b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/target-validator.json index 858d42480d3..60cbf382e26 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/target-validator.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/target-validator.json @@ -34,12 +34,41 @@ "ns.foo#MyService": { "type": "service", "version": "2017-01-17", + "operations": [ + { + "target": "ns.foo#ValidOperation" + }, + { + "target": "ns.foo#InalidOperationInputOutputErrorNotFound" + }, + { + "target": "ns.foo#InalidOperationInputOutputErrorBadTypes" + }, + { + "target": "ns.foo#InvalidOperationBadErrorTraits" + } + ], "resources": [ { "target": "ns.foo#MyResource" }, { "target": "ns.foo#InvalidResourceLifecycle" + }, + { + "target": "ns.foo#InvalidResourceIdentifierType" + }, + { + "target": "ns.foo#InvalidResourceIdentifierReference" + }, + { + "target": "ns.foo#InvalidResourceBindingReference" + }, + { + "target": "ns.foo#InvalidResourceBindingType" + }, + { + "target": "another.ns#InvalidResource2" } ] }, @@ -122,6 +151,33 @@ "members": { "integer": { "target": "ns.foo#Integer" + }, + "list": { + "target": "ns.foo#ValidList" + }, + "map": { + "target": "ns.foo#ValidMap" + }, + "another": { + "target": "another.ns#String" + }, + "another1": { + "target": "ns.foo#InvalidListMemberReference" + }, + "another2": { + "target": "ns.foo#InvalidListMemberMember" + }, + "another3": { + "target": "ns.foo#InvalidListMemberResource" + }, + "another4": { + "target": "ns.foo#InvalidListMemberService" + }, + "another5": { + "target": "ns.foo#InvalidMapType" + }, + "another6": { + "target": "ns.foo#InvalidTraitReference" } } }, diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/unreferenced-shape-validator.errors b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/unreferenced-shape-validator.errors new file mode 100644 index 00000000000..caa3aadb182 --- /dev/null +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/unreferenced-shape-validator.errors @@ -0,0 +1,2 @@ +[NOTE] ns.foo#UnreferencedString: The string shape is not connected to from any service shape. | UnreferencedShape +[NOTE] ns.foo#UnreferencedStructure: The structure shape is not connected to from any service shape. | UnreferencedShape diff --git a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/unreferenced-shape-validator.json b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/unreferenced-shape-validator.json similarity index 93% rename from smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/unreferenced-shape-validator.json rename to smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/unreferenced-shape-validator.json index 32a3f2330ff..132e3e2763c 100644 --- a/smithy-linters/src/test/resources/software/amazon/smithy/linters/errorfiles/unreferenced-shape-validator.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/unreferenced-shape-validator.json @@ -66,12 +66,5 @@ "ns.foo#UnreferencedString": { "type": "string" } - }, - "metadata": { - "validators": [ - { - "name": "UnreferencedShape" - } - ] } } diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/loader/main.json b/smithy-model/src/test/resources/software/amazon/smithy/model/loader/main.json index e6394e7fb30..e0914d0803b 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/loader/main.json +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/loader/main.json @@ -81,6 +81,14 @@ "list": [ "a", "b" + ], + "suppressions": [ + { + "ids": ["UnreferencedShape"], + "shapes": [ + "example.namespace#"], + "reason": "This shape is being tested for model assembly." + } ] } }