swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

bug: IntegerSchema returns null for negative values for some locales

Open jhannes opened this issue 3 years ago • 1 comments

NumberFormat.getInstance().parse(Integer.toString(-1)) always throws exception in the following locales: ar· ·ckb· ·he· ·ks· ·pa_Arab· ·ur· ·fa· ·ps· ·uz_Arab· ·eo· ·et· ·fi· ·fo· ·gsw· ·ksh· ·lt· ·nb· ·nn· ·rm· ·se· ·sv· (see https://bugs.openjdk.java.net/browse/JDK-8189097)

This means that schemas with negative enum values will replace these with null if swagger parser is used on a computer with one of the special locales, making development hard for e.g. Norwegian or Finnish developers.

I've created a small pull request which fixes the problem at #4178

jhannes avatar Jul 21 '22 12:07 jhannes

I support that this needs to be fixed asap! Thank you @jhannes !

pteigen avatar Jul 21 '22 12:07 pteigen