When generating models with string properties having maxLength or minLength, strlen is used for validating max/min length of the string. While this works for English language it will not work properly for other languages such as German, since strlen returns number of bytes not number of character.
2.3.0
Any swagger declaration file having models with string properties and maxLength or minLength.
For example:
definitions:
Person:
Name:
type: "string"
maxLength: 4
See command line for php code generation
Use mb_strlen instead of strlen. Also add option to define encoding to use for mb_strlen.
@dParadiz Nice catch! Can you attach a PR for this?
@ackintosh What do yo mean by PR? I could not fund any similar or related reported issues.
@dParadiz I'm sorry for my poor English. 馃挦
Could you create a PR which fixes this issue?
@ackintosh Sorry, it's just my understanding of abbreviation PR. Do you mean that I add proposal for this issue or is PR something else?
Ah, PR is Pull Request 馃挕
I'll submit the Pull Request which fixes this issue later.
@dParadiz the issue has been fixed by the PR filed by @ackintosh
Please pull the latest master to give it another try.
@wing328 I can confirm that it works in my case.
@dParadiz thanks for the confirmation
Most helpful comment
@wing328 I can confirm that it works in my case.