private void checkNonNumeric(Shape shape, RangeTrait trait, StringNode node, Emitter emitter, Context context) {
        NonNumericFloat.fromStringRepresentation(node.getValue()).ifPresent(value -> {
            if (value.equals(NonNumericFloat.NAN)) {
                emitter.accept(node,
                        getSeverity(context),
                        String.format(
                                "Value provided for `%s` must be a number because the `smithy.api#range` trait is applied, "
                                        + "but found \"%s\"",
                                shape.getId(),
                                node.getValue()));
            }

            if (trait.getMin().isPresent() && value.equals(NonNumericFloat.NEGATIVE_INFINITY)) {
                emitter.accept(node,
                        getSeverity(context),
                        String.format(
                                "Value provided for `%s` must be greater than or equal to %s, but found \"%s\"",
                                shape.getId(),
                                trait.getMin().get(),
                                node.getValue()),
                        shape.isMemberShape() ? MEMBER : TARGET,
                        INVALID_RANGE);
            }

            if (trait.getMax().isPresent() && value.equals(NonNumericFloat.POSITIVE_INFINITY)) {
                emitter.accept(node,
                        getSeverity(context),
                        String.format(
                                "Value provided for `%s` must be less than or equal to %s, but found \"%s\"",
                                shape.getId(),
                                trait.getMax().get(),
                                node.getValue()),
                        shape.isMemberShape() ? MEMBER : TARGET,
                        INVALID_RANGE);
            }
        });
    }
Validates the range trait on number shapes or members that target them.
smithy-model/src/main/java/software/amazon/smithy/model/validation/node/RangeTraitPlugin.java