Skip to content

Conversation

ryodocx
Copy link

@ryodocx ryodocx commented Jun 19, 2022

Summary

  • In this PullRequest, add validator in order to count string length correctly.
  • Current, StringLenBetween() count byte length.
  • For example Japanese, 1 character mean 3 bytes in UTF-8.
    • Sometimes, improper validation implements in terraform-provider via this behavior

What's changes?

  • add StringRuneCountBetween() for validate number of characters
  • add StringBytesBetween() for validate number of bytes (it's just copy of StringLenBetween())
  • StringLenBetween() is to deprecated
  • add validation for parameters(min, max)
  • add test

Related issues

@ryodocx ryodocx requested a review from a team as a code owner June 19, 2022 15:21
@ryodocx
Copy link
Author

ryodocx commented Jul 17, 2022

@bflad Could you help this PR?

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.

1 participant