question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Try to generate document.html and json with maven plugin and spring boot 1.3.0.M5

See original GitHub issue

I try without any success to generate static files from swagger maven plugin.

            <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <springmvc>true</springmvc>
                            <locations>com.web.controler</locations>
                            <schemes>http</schemes>
                            <host>localhost:8080</host>
                            <basePath>/</basePath>
                            <info>
                                <title>Swagger sample</title>
                                <version>v2</version>
                                <description>
                                    This is the Rest API Documentation 
                                </description>
                                <contact>
                                    <email>toto@mail.com</email>
                                    <name>toto</name>
                                </contact>
                            </info>
                            <templatePath>${basedir}/src/test/resources/strapdown.html.hbs</templatePath>
                            <outputPath>${basedir}/generated/document.html</outputPath>
                            <swaggerDirectory>${basedir}/generated/swagger-ui</swaggerDirectory>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    <dependencies>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-core</artifactId>
            <version>1.5.3</version>
        </dependency>

Document.html and json are generated but without any API detected

I have my rest controller annotated like bellow

/**
 * Handles requests for rest call.
 */
@Api(value = "/")
@RestController
public class RestController {

    @ApiOperation(value = "Load pet parent tree", notes = "notes", response = Pet .class)
    @RequestMapping(value = "/rest/tree/pet", method = RequestMethod.GET)
    public Pet loadParentsTree(
            @ApiParam(required = true, value = "petId") @PathVariable String petId
            HttpServletResponse response) {

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

6reactions
fabMrccommented, May 9, 2017

Nice I am waiting to use it without swagger specific annotation (only spring mvc) is it possible ?

1reaction
PAX523commented, Sep 14, 2017

If you use Spring Boot you have to make sure that your @RequestMapping uses the value attribute instead of path. Otherwise, no API is detected.

See: #467

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot Reference Guide
Spring Boot Documentation. This section provides a brief overview of Spring Boot reference documentation. Think of it as map for the rest of...
Read more >
Spring Boot Reference Guide
If you're just getting started with Spring Boot, or 'Spring' in general, this is the section for you! Here we answer the basic...
Read more >
Spring Boot Reference Documentation
Try the How-to documents. They provide solutions to the most common questions. Learn the Spring basics. Spring Boot builds on many other Spring...
Read more >
Spring Boot Reference Guide
Deploy Spring Boot Applications: Cloud Deployment | OS Service; Build tool plugins: Maven | Gradle; Appendix: Application Properties | Auto-configuration ...
Read more >
Spring Boot Reference Guide
Spring Boot also provides an optional Maven plugin to create executable jars. ... Always try to use the equivalent Java-based configuration if possible....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found