Skip to content

Commit

Permalink
Adjust sSDK error message when using @range on floating point shapes (
Browse files Browse the repository at this point in the history
#2727)

To point to a better issue
#2007.

Also let users know this is unlikely to ever get implemented.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
  • Loading branch information
david-perez authored Jul 21, 2023
1 parent 6aa585f commit d5674b8
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ private sealed class UnsupportedConstraintMessageKind {
shape: Shape,
constraintTrait: Trait,
trackingIssue: String,
willSupport: Boolean = true,
) =
buildMessage(
"The ${shape.type} shape `${shape.id}` has the constraint trait `${constraintTrait.toShapeId()}` attached.",
willSupport = true,
willSupport,
trackingIssue,
)

Expand Down Expand Up @@ -104,7 +105,12 @@ private sealed class UnsupportedConstraintMessageKind {

is UnsupportedRangeTraitOnShape -> LogMessage(
level,
buildMessageShapeHasUnsupportedConstraintTrait(shape, rangeTrait, constraintTraitsUberIssue),
buildMessageShapeHasUnsupportedConstraintTrait(
shape,
rangeTrait,
willSupport = false,
trackingIssue = "https://github.com/awslabs/smithy-rs/issues/2007",
),
)

is UnsupportedUniqueItemsTraitOnShape -> LogMessage(
Expand Down Expand Up @@ -250,7 +256,7 @@ fun validateUnsupportedConstraints(
unsupportedConstraintOnNonErrorShapeReachableViaAnEventStreamSet + unsupportedConstraintErrorShapeReachableViaAnEventStreamSet

// 3. Range trait used on unsupported shapes.
// TODO(https://github.com/awslabs/smithy-rs/issues/1401)
// TODO(https://github.com/awslabs/smithy-rs/issues/2007)
val unsupportedRangeTraitOnShapeSet = walker
.walkShapes(service)
.asSequence()
Expand Down

0 comments on commit d5674b8

Please sign in to comment.