swagger-gradle-codegen icon indicating copy to clipboard operation
swagger-gradle-codegen copied to clipboard

Add null value handling for kotlin TypesAdapters

Open mikeyshean opened this issue 5 years ago • 4 comments

PR for #109

mikeyshean avatar Feb 11 '20 23:02 mikeyshean

@macisamuele @martinbonnin @cortinico Any thoughts on this PR?

We spent a day and a half debugging this issue and @mikeyshean discovered that toJson needs to handle null values otherwise it triggers an issue in Moshi thinking there is a nesting problem and exception gets thrown by Moshi.

djensen47 avatar Feb 12 '20 18:02 djensen47

@mikeyshean thank a lot for the contribution 🎉

The pr looks sane to me, but I need some time to verify it. It looks surprising that we haven't face this issue before.

Something that for sure I'll ask is to have testing coverage over the change and ideally a unit test in samples/junit-test that ensures no further regressions around this.

macisamuele avatar Feb 13 '20 12:02 macisamuele

Any news on this?

klaszlo8207 avatar Jan 12 '21 12:01 klaszlo8207

Sorry, the project we were using this on was canceled. @klaszlo8207 feel free to pick up this PR and add a regression test to it.

djensen47 avatar Jan 12 '21 17:01 djensen47