Skip to content

Fix selector in RawIntegerWithoutRange examples#2966

Closed
tlindsay42 wants to merge 1 commit intosmithy-lang:mainfrom
tlindsay42:fix-raw-integer-without-range-example
Closed

Fix selector in RawIntegerWithoutRange examples#2966
tlindsay42 wants to merge 1 commit intosmithy-lang:mainfrom
tlindsay42:fix-raw-integer-without-range-example

Conversation

@tlindsay42
Copy link

@tlindsay42 tlindsay42 commented Feb 12, 2026

Background

  • What do these changes do?
    Fixes the selector in each example
  • Why are they important?
    Examples should work as advertised
Existing documentation excerpt

Ref: https://smithy.io/2.0/guides/model-validation-examples.html#require-integers-to-have-a-range-constraint

This example shows how to require all integers used in an operation input have a range constraint with both a minimum and maximum value. The first validator checks that the range trait exists on the shape, while the other two validators check that both the maximum and minimum values of the range are both filled out.

Existing experience

screenshot1

Proposed experience

screenshot2

screenshot3

Testing

  • How did you test these changes?
    In my current project. AWS employee, so feel free to DM me if you have questions.

Links


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tlindsay42 tlindsay42 requested a review from a team as a code owner February 12, 2026 22:27
@tlindsay42 tlindsay42 requested a review from yasmewad February 12, 2026 22:27
@github-actions
Copy link
Contributor

This pull request does not contain a staged changelog entry. To create one, use the ./.changes/new-change command. For example:

./.changes/new-change --pull-requests "#2966" --type feature --description "Fix selector in RawIntegerWithoutRange examples"

Make sure that the description is appropriate for a changelog entry and that the proper feature type is used. See ./.changes/README or run ./.changes/new-change -h for more information.

@tlindsay42
Copy link
Author

Ready for review @yasmewad :)

@kstich
Copy link
Contributor

kstich commented Feb 13, 2026

I've left a comment over on the issue for this - #2965 (comment)

@tlindsay42
Copy link
Author

Per our discussion, you will not accept this PR because the desired outcome that description & message template in this example is intended to communicate is to create a custom integer separate with the @range trait and reference that. You will consider submitting your own PR to update the documentation and/or message template to make this desired outcome clearer.

Disagree & commit

Example
operation GetFoo {
    input := {
        something: SomethingValue
    }
}

@range(min: 1, max, 10)
integer SomethingValue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RawIntegerWithoutRange validator examples are invalid

2 participants