wso2 / msf4j

WSO2 Microservices Framework for Java (MSF4J)
http://wso2.com/products/microservices-framework-for-java/
Apache License 2.0
400 stars 349 forks source link

Getting class name in path of Swagger output #536

Open alienatorZ opened 6 years ago

alienatorZ commented 6 years ago

Im getting a class name in the path definition for Swagger.

Here is my output ... "paths": { "/@javax.ws.rs.Path(value=/objSvc)/hello/json": { "get": { "operationId": "get1", "produces": [ ...

here is the definition: @Path("/objSvc") public class NewService {

@GET
@Path("/hello/json")
@Produces("application/json")
public MyObj get1() {
    // TODO: Implementation for HTTP GET request
    System.out.println("GET invoked");
    MyObj m = new MyObj();
    m.setId("sdfsadf");
    m.setNum1(1);
    return m;
}

@GET
@Path("/hello/xml")
@Produces("application/xml")
public MyObj get2() {
    // TODO: Implementation for HTTP GET request
    System.out.println("GET invoked");
    MyObj m = new MyObj();
    m.setId("sdfsadf");
    m.setNum1(1);
    return m;
}

}

Any ideas why I would be seeing this as opposed to

/objSvc/hello/json ??

Thanks, AlienatorZ

inem88 commented 6 years ago

Do you solve this problem??

inem88 commented 6 years ago

I found that it was work correct in version 2.2.2. So you can use

    <dependency>
        <groupId>org.wso2.msf4j</groupId>
        <artifactId>msf4j-swagger</artifactId>
        <version>2.2.2</version>
    </dependency>