Closed wimdeblauwe closed 8 years ago
Thanks for the suggestion. Unfortunately it's not that simple as the directory is dependent on the build system that's being used: Maven uses target
and Gradle uses build
.
Would it be possible to define a property? For example, if you put in application.properties
:
spring.test.restdocs.outputDir=target/generated-snippets
That then this would be the default?
I might be possible but I'd rather not do so as I don't think it'll be necessary when Boot upgrades to REST Docs 1.2.
REST Docs 1.2 automatically figures out what the output directory should be based on the build system you're using. It also comes with an Asciidoctor extension to automatically configure a snippets
attribute that you can use when you include
a snippet in your .adoc
file. See http://docs.spring.io/spring-restdocs/docs/1.2.0.BUILD-SNAPSHOT/reference/html5/#getting-started-documentation-snippets-setup-junit and http://docs.spring.io/spring-restdocs/docs/1.2.0.BUILD-SNAPSHOT/reference/html5/#working-with-asciidoctor-including-snippets for more details.
That is even better! Thanks.
Would it not be easier to have
target/generated-snippets
as the default output directory on the@AutoConfigureRestDocs
annotation instead of an empty string? Seems like the most sensible default.