play-swagger
play-swagger copied to clipboard
Issue with java.util.Date and scala Map
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),
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.
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