springdoc / springdoc-openapi-maven-plugin

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
143 stars 37 forks source link

Error while working with context-path #61

Open guilhermecgs opened 1 year ago

guilhermecgs commented 1 year ago

After adding a single line: server.servlet.context-path=/mytest

I start receiving an error on (mvn clean verify)

[INFO] 
[INFO] --- springdoc-openapi-maven-plugin:1.4:generate (integration-test) @ demo ---
[ERROR] An error has occured: Response code 404
[INFO] 
[INFO] --- spring-boot-maven-plugin:3.1.0:stop (default) @ demo ---

See here. Just clone to reproduce

https://github.com/guilhermecgs/demo/commit/1865f486a53316bac0938a863c2c27573b1d1249

guilhermecgs commented 1 year ago

Does springdoc works with context path well on spring boot 3?

jjcosare commented 6 months ago

Somehow it doesn't detect automatically so we had to update the default:


<plugin>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <apiDocsUrl>http://localhost:8080${server.servlet.context-path}/v3/api-docs</apiDocsUrl>
                </configuration>
            </plugin>