Swagger UI not displaying Model and Model Schema when using Map

138 views
Skip to first unread message

amit kawatra

unread,
May 24, 2016, 1:18:19 PM5/24/16
to Swagger

Hi All, 
I am having an application in Spring Boot having dependency
springfox-swagger2 - version 2.2.2

Swagger UI not displaying Model and Model Schema when using Map <>, 
it shows empty schema {}

@ApiOperation(value = "hello", nickname = "hello", notes="description") public @ResponseBody Map <String>, <Object`> `greeting(@RequestParam(value = "name") String name)

{
Map m = Maps.newHashMap();`

    m.put("1", name);

    return m;
}`

`public class TestApplication {

public static void main(String[] args) {
    SpringApplication.run(TestApplication.class, args);
}
@Bean
public Docket newsApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .groupName("greetings")
            .apiInfo(apiInfo())
            .select()
            .paths(Predicates.not(PathSelectors.regex("/error.*")))
            .build();
}`

Ron Ratovsky

unread,
May 24, 2016, 2:07:00 PM5/24/16
to swagger-sw...@googlegroups.com

For springfox related questions, I’d suggest opening a ticket directly on the project.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages