-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully handle the case when additionSchema targets an invalid sha…
…pe (#1708)
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...mazon/smithy/aws/cloudformation/traits/errorfiles/invalid-additional-schemas-shape.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ERROR] smithy.example#InvalidAdditionalSchemasShapeResource: Error validating trait `aws.cloudformation#cfnResource`.additionalSchemas.0: Shape ID `smithy.example#ListShape` does not match selector `structure` | TraitValue | ||
[NOTE] smithy.example#ListShape: The list shape is not connected to from any service shape. | UnreferencedShape | ||
[WARNING] smithy.example#InvalidAdditionalSchemasShapeResource: This shape applies a trait that is unstable: aws.cloudformation#cfnResource | UnstableTrait |
58 changes: 58 additions & 0 deletions
58
...mazon/smithy/aws/cloudformation/traits/errorfiles/invalid-additional-schemas-shape.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
$version: "2.0" | ||
|
||
namespace smithy.example | ||
|
||
use aws.cloudformation#cfnResource | ||
|
||
service InvalidAdditionalSchemasShape { | ||
version: "2020-07-02", | ||
resources: [ | ||
InvalidAdditionalSchemasShapeResource, | ||
], | ||
} | ||
|
||
@cfnResource( | ||
additionalSchemas: [ListShape] | ||
) | ||
resource InvalidAdditionalSchemasShapeResource { | ||
identifiers: { | ||
fooId: String, | ||
}, | ||
create: CreateInvalidAdditionalSchemasShapeResource, | ||
read: GetInvalidAdditionalSchemasShapeResource, | ||
} | ||
|
||
list ListShape { | ||
member: String | ||
} | ||
|
||
operation CreateInvalidAdditionalSchemasShapeResource { | ||
input: CreateInvalidAdditionalSchemasShapeResourceRequest, | ||
output: CreateInvalidAdditionalSchemasShapeResourceResponse | ||
} | ||
|
||
@input | ||
structure CreateInvalidAdditionalSchemasShapeResourceRequest { | ||
bar: String, | ||
} | ||
|
||
@output | ||
structure CreateInvalidAdditionalSchemasShapeResourceResponse {} | ||
|
||
@readonly | ||
operation GetInvalidAdditionalSchemasShapeResource { | ||
input: GetInvalidAdditionalSchemasShapeResourceRequest, | ||
output: GetInvalidAdditionalSchemasShapeResourceResponse, | ||
} | ||
|
||
@input | ||
structure GetInvalidAdditionalSchemasShapeResourceRequest { | ||
@required | ||
fooId: String, | ||
} | ||
|
||
@output | ||
structure GetInvalidAdditionalSchemasShapeResourceResponse { | ||
bar: String, | ||
} | ||
|