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

Issue with java.util.Date and scala Map

Open sk3749614 opened this issue 8 years ago • 2 comments

I am having issues with case classes that contain Date and scala Map. These show up as entities which are then not able to be read by Swagger CodeGen. How do I handle these types? Below is the model that is being created

metaData (collection.immutable.map[string,string]), createdAt (java.util.date),

sk3749614 avatar Jun 18 '16 09:06 sk3749614

playswagger doesn't support generating schema for map and java.util.date out of box. contribution to add those support is welcome, but in the meantime you can override those field with your own schema definition: this is one of the strengths of play-swagger, you can always override easily with your own swagger definition.

kailuowang avatar Jun 18 '16 14:06 kailuowang

You can create in swagger-custom-mappings.yml custom definiton for map type like this:

  - type: collection\.immutable\.map\[string\,string\]
    specAsParameter:
      - type: object
    specAsProperty:
      type: object

yarosman avatar Feb 26 '18 09:02 yarosman