DoclerLabs / api-client-generator

API client generator is a console application capable of generating an API client based on OpenAPI(Swagger) specification.
MIT License
31 stars 19 forks source link

Improved string length checking #49

Closed guilhermednt closed 3 years ago

guilhermednt commented 3 years ago

Currently strlen is being used to check string lengths, however this is not adequate as it actually counts bytes, not characters.

This PR fixes that by using grapheme_strlen to accurately count characters as perceived by humans.

I propose considering this a breaking change as it can significantly change how validations work.

vsouz4 commented 3 years ago

merging, however I'm wondering if we shouldn't add ext-intl in generated api clients

guilhermednt commented 3 years ago

That's actually a very good point @vsouz4, I totally forgot about that.