Issue with Template type class return

18 views
Skip to first unread message

Provash Dowari

unread,
Oct 13, 2017, 9:59:10 AM10/13/17
to Swagger
Hi,

I have one issue with Template type class return scenario. I am using swagger-jaxrs2-2.0.0-rc2 version for document json generation and swagger-ui-v3.3.1 for UI.  below is the explanation.

Example:
Class property method return Template type.
Class A{
    B b;
}
Class IssueTemplate<T>{}
Class B{
public IssueTemplate<Ret> getTest(){};
}

Request body :
@Path("/test")
@Secured
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
@Operation(tags="/receiver/rest")
public void test1( A a) {
}

Generated openapi.json :

"components" : {
    "schemas" : {
      "B":{
          "properties" :{
              "test":: {
                     "$ref" : "#/components/schemas/IssueTemplateRet"
                }}}
      "IssueTemplate":{
       }
   }
}

So here issue : TemplateTyped Class return type Ref path created with concatenation of TemaplateType class and Template class. Here "IssueTemplate" and "Ret". Due to this UI is throwing error.


Regards,
provash



Francesco Tumanischvili

unread,
Oct 16, 2017, 11:33:38 AM10/16/17
to Swagger
Hey Provash,

thanks for reporting this. Issue should be fixed in https://github.com/swagger-api/swagger-core/pull/2483 and part of next RC. With the fix, concatenated name is used as defined key in components.schemas and is therefore correctly referenced.
Reply all
Reply to author
Forward
0 new messages