1

Hi I'm forcing problem with probably deserializer. So I've got response object like:

Map<Pair<Int, String>, List<DTO>>

But in swagger model it's visible as:

{ < * >: [...] }

Ofc I have jackson deserializer based on Deserializing non-string map keys with Jackson

Update : I'm expecting to have instead of < * >. Or some nammed by me values like id and name. I've also tried to set Object in place of key instead of pair but nothing happens.

Map<Keyobj, List<DTO>>
data class Keyobj(val int: Int, val string: String)
MrNetroful
  • 497
  • 8
  • 28
  • 1) Can you provide some more details about what you are trying to do, what result you expect and what exactly is not working? As your question is currently written, it's hard to tell what the problem is. 2) OpenAPI Specification and Swagger tools only support maps with string keys so they cannot natively represent `Pair` and `Map`. Whether or not something like this can possibly work probably depends on how serialization/deserialization are implemented. – Helen Oct 29 '18 at 13:28
  • By "<*>: [...]" do you mean something [like this](https://i.stack.imgur.com/A6CuA.png), that is, the model structure as displayed in Swagger UI? If so, that's simply Swagger UI's way to indicate that the structure is a dictionary / hashmap. You can, however, provide an `example` (sample JSON) to be displayed on the "Example Value" tab in Swagger UI. – Helen Oct 29 '18 at 19:45
  • I cannot upload example to swagger because of this issue https://github.com/springfox/springfox/issues/2352. – MrNetroful Oct 30 '18 at 22:02

0 Answers0