|
Current logic present in DefinitionGenerator#processUnionType has no clue about the type of default value anyway.
What is done there is:
- check for string, boolean or number type in a cycle
- as a consequence we can have as a result string, boolean and number at the same time
- what is correct because that the nature of union
- then we are trying to cast default value to some type preferring string - what is not correct
I propose to delete DefinitionGenerator#processUnionType, use first member type for generating example and omitting default value at all.
|