swagger-api / swagger-play

Apache License 2.0
330 stars 181 forks source link

swagger-play renders a Java object property as "number" in swagger.json #124

Open bleicher opened 7 years ago

bleicher commented 7 years ago

Hi folks, public class TestView { public Map<String, Object> stringObjectMap; public Map<String, String> stringStringMap; public Object object; }

results in

"TestView" : { "type" : "object", "properties" : { "stringObjectMap" : { "type" : "object", "additionalProperties" : { "type" : "number" } }, "stringStringMap" : { "type" : "object", "additionalProperties" : { "type" : "string" } }, "object" : { "type" : "number" } } },

The "number"s don't make any sense to me. Instead of

"object" : { "type" : "number" }

I would expect

"object" : { "type" : "object" }

I've written a test for the play-2.4 directory, which is what I'm using, and copied it to the play-2.5 directory, where it's also not working.

(In play-2.5 the tests were not running because the Definitions.size is 6, not 5, which I also fixed.)

This can be pulled from bleicher/swagger-play (I'm not completely familiar with github, so if I should do a proper "pull request" to make life easier, say so).

A bugfix or a hint that I'm missing something would be really appreciated.

Markus