-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add service id to the error message to aid debugging (#2483)
- Loading branch information
Showing
10 changed files
with
194 additions
and
22 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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...mazon/smithy/aws/traits/errorfiles/tagging/invalid-tag-enabled-service-list-broken.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[DANGER] example.weather#Weather: Shape `example.weather#ListTagsForResource` does not satisfy 'ListTagsForResource' operation requirements. | ServiceTagging | ||
[ERROR] example.weather#City: Resource does not have tagging CRUD operations and is not compatible with service-wide tagging operations. | TaggableResource | ||
[ERROR] example.weather#City: Resource does not have tagging CRUD operations and is not compatible with service-wide tagging operations for service `example.weather#Weather`. | TaggableResource | ||
[WARNING] example.weather#Weather: Service marked `aws.api#tagEnabled` trait does not have consistent tagging operations implemented: {TagResource, UntagResource, and ListTagsForResource}. | TagEnabledService |
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
.../amazon/smithy/aws/traits/errorfiles/tagging/invalid-tag-service-wide-two-services.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 @@ | ||
[WARNING] example.weather#Forecast: Resource is likely missing `aws.api#taggable` trait. | TaggableResource | ||
[WARNING] example.weather#AnotherService: Service has resources with `aws.api#taggable` applied but does not have the `aws.api#tagEnabled` trait. | TaggableResource | ||
[ERROR] example.weather#City: Resource does not have tagging CRUD operations and is not compatible with service-wide tagging operations for service `example.weather#AnotherService`. | TaggableResource |
168 changes: 168 additions & 0 deletions
168
.../amazon/smithy/aws/traits/errorfiles/tagging/invalid-tag-service-wide-two-services.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,168 @@ | ||
$version: "2.0" | ||
|
||
metadata suppressions = [ | ||
{ | ||
id: "UnstableTrait", | ||
namespace: "example.weather" | ||
} | ||
] | ||
|
||
namespace example.weather | ||
|
||
use aws.api#arn | ||
use aws.api#taggable | ||
use aws.api#tagEnabled | ||
|
||
@tagEnabled | ||
service Weather { | ||
version: "2006-03-01", | ||
resources: [City] | ||
operations: [GetCurrentTime, TagResource, UntagResource, ListTagsForResource] | ||
} | ||
|
||
@internal | ||
service AnotherService { | ||
version: "2006-03-01" | ||
resources: [AnotherResouce] | ||
} | ||
|
||
@arn(template: "resource/{resourceId}/another") | ||
resource AnotherResouce { | ||
identifiers: { | ||
cityId: CityId | ||
} | ||
resources: [ | ||
City | ||
] | ||
} | ||
|
||
structure Tag { | ||
key: String | ||
value: String | ||
} | ||
|
||
list TagList { | ||
member: Tag | ||
} | ||
|
||
list TagKeys { | ||
member: String | ||
} | ||
|
||
operation TagResource { | ||
input := { | ||
@required | ||
arn: String | ||
@length(max: 128) | ||
tags: TagList | ||
} | ||
output := { } | ||
} | ||
|
||
operation UntagResource { | ||
input := { | ||
@required | ||
arn: String | ||
@required | ||
tagKeys: TagKeys | ||
} | ||
output := { } | ||
} | ||
|
||
operation ListTagsForResource { | ||
input := { | ||
@required | ||
arn: String | ||
} | ||
output := { | ||
@length(max: 128) | ||
tags: TagList | ||
} | ||
} | ||
|
||
@arn( | ||
template: "city/{cityId}/forecast/{forecastId}" | ||
) | ||
resource Forecast { | ||
identifiers: { | ||
cityId: CityId | ||
forecastId: ForecastId | ||
} | ||
} | ||
|
||
@taggable(property: "tags") | ||
@arn(template: "city/{CityId}") | ||
resource City { | ||
identifiers: { cityId: CityId } | ||
properties: { | ||
name: String | ||
coordinates: CityCoordinates | ||
} | ||
read: GetCity | ||
resources: [Forecast] | ||
} | ||
|
||
@pattern("^[A-Za-z0-9 ]+$") | ||
string ForecastId | ||
|
||
@pattern("^[A-Za-z0-9 ]+$") | ||
string CityId | ||
|
||
@readonly | ||
operation GetCity { | ||
input: GetCityInput | ||
output: GetCityOutput | ||
errors: [NoSuchResource] | ||
} | ||
|
||
@input | ||
structure GetCityInput { | ||
// "cityId" provides the identifier for the resource and | ||
// has to be marked as required. | ||
@required | ||
cityId: CityId | ||
} | ||
|
||
@output | ||
structure GetCityOutput { | ||
// "required" is used on output to indicate if the service | ||
// will always provide a value for the member. | ||
@required | ||
name: String, | ||
|
||
@required | ||
coordinates: CityCoordinates | ||
} | ||
|
||
// This structure is nested within GetCityOutput. | ||
structure CityCoordinates { | ||
@required | ||
latitude: Float, | ||
|
||
@required | ||
longitude: Float, | ||
} | ||
|
||
// "error" is a trait that is used to specialize | ||
// a structure as an error. | ||
@error("client") | ||
structure NoSuchResource { | ||
@required | ||
resourceType: String | ||
} | ||
|
||
@readonly | ||
operation GetCurrentTime { | ||
input: GetCurrentTimeInput | ||
output: GetCurrentTimeOutput | ||
} | ||
|
||
@input | ||
structure GetCurrentTimeInput {} | ||
|
||
@output | ||
structure GetCurrentTimeOutput { | ||
@required | ||
time: Timestamp | ||
} | ||
|
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