Servlet - Post method - @ApiImplicitParam - Swagger Maven Plugin

246 views
Skip to first unread message

Ioannis Kavvouras

unread,
Apr 11, 2014, 7:28:08 AM4/11/14
to swagger-sw...@googlegroups.com
Hello,

I am trying to generate in  a servlet the json and html files, on no-server-integration mode with maven-plugin.

In the doPost method i have the following

@ApiOperation(httpMethod = "POST", value = "requests on manager")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = ParametersNames.ACTION, value = "action on manager", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = ParametersNames.FORMAT, value = "format of request", required = true, dataType = "string", paramType = "query") })
    protected void doPost(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException

in the pom file I have
<dependency>
            <groupId>com.wordnik</groupId>
            <artifactId>swagger-servlet_2.9.1</artifactId>
            <version>1.3.1</version>
        </dependency>

 and
<plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <locations>gr.uoa.di.madgik</locations>
                            <apiVersion>v1</apiVersion>
                            <basePath>http://localhost:8080/ServicesCatalogManagerServlet</basePath>
                            <outputTemplate>
                                https://raw.github.com/kongchen/api-doc-template/master/v2.0/html.mustache
                            </outputTemplate>
                            <outputPath>${basedir}/src/main/webapp/index.html</outputPath>
                            <swaggerDirectory>${basedir}/src/main/webapp/apidocs</swaggerDirectory>
                            <mustacheFileRoot>${basedir}/src/main/resources/</mustacheFileRoot>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


what I get in the WCSCatalogManagerServlet.json file is:
{
  "apiVersion" : "v1",
  "swaggerVersion" : "1.2",
  "basePath" : "http://localhost:8080/ServicesCatalogManagerServlet",
  "resourcePath" : "/WCSCatalogManagerServlet"
}

could you please explain me why the Parameter annotations do not appear?

Regards
Yannis

Ron

unread,
Apr 16, 2014, 9:26:21 AM4/16/14
to swagger-sw...@googlegroups.com
Hi Yannis,

How is this issue related with the one we're currently trying to solve? Do need assistance here as well?


--
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.

Ioannis Kavvouras

unread,
Apr 16, 2014, 9:32:39 AM4/16/14
to swagger-sw...@googlegroups.com
This was my first approach, but it failed as well. At first I tried to work without a server integration. Then I decided to go with the server integration due to the fact that another project with jersey+jax-rs worked fine, in contrast to the one with servlet.

Regards
Yannis
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/UuAD6bevmyE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages