I’m using swagger-codegen-maven-plugin 2.4.5 under Java 8 to build a client library. Whilst it generates classes fine, making an API call to /Line/Mode/{mode}/Status fails, because the autogenerated code is calling /Line/Mode/%5Btube,%20dlr%5D/Status?detail=true, rather than /Line/Model/tube,dlr/Status?detail=true. The lineStatusByMode method call in LineApi requires a List of Strings (and I’m passing an ArrayList) and a Boolean, and it looks like it’s simply doing .toString() on the List.
Can anyone help? Whilst I could hack around this by editing autogenerated code, I’d rather not!
That’s the effect of calling .toString() on a List in Java - “[foo, bar]” rather than what I think swagger-codegen expects - and what the Unified API wants, which is “foo,bar”.
The autogenerated method requires a List, and won’t let me supply a String. If I dispense with the autogenerated code, I have another problem of deserializing the returned objects in to domain objects.
As far as I’m aware, the “$type” key in the returned JSON is a Microsoft-specific thing, and I don’t want to get wrapped up in writing my own deserialization code