You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Migrate existing Spring REST Docs tests](#migrate-existing-spring-rest-docs-tests)
51
51
-[MockMvc based tests](#mockmvc-based-tests)
52
-
-[REST Assured based tests](#rest-assured-based-tests)
53
52
-[WebTestClient based tests](#webtestclient-based-tests)
54
53
-[Security Definitions in OpenAPI](#security-definitions-in-openapi)
55
54
-[Running the gradle plugin](#running-the-gradle-plugin)
@@ -70,10 +69,11 @@ This is why we came up with this project.
70
69
71
70
Spring Boot and Spring REST Docs 3.0.0 introduced [breaking chances to how request parameters are documented: `RequestParameterSnippet` was split into `QueryParameterSnippet` and `FormParameterSnippet`.](https://github.com/spring-projects/spring-restdocs/issues/832)
72
71
73
-
|Spring Boot version | restdocs-api-spec version|
74
-
|---|---|
75
-
|3.x|0.17.1 or later|
76
-
|2.x|0.16.4|
72
+
| Spring Boot version | restdocs-api-spec version |
@@ -83,7 +83,6 @@ The project consists of the following main components:
83
83
This is most importantly the [ResourceDocumentation](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apispec/ResourceDocumentation.kt) which is the entry point to use the extension in your tests.
84
84
The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apispec/ResourceSnippet.kt) is the snippet used to produce a json file `resource.json` containing all the details about the documented resource.
85
85
-[restdocs-api-spec-mockmvc](restdocs-api-spec-mockmvc) - contains a wrapper for `MockMvcRestDocumentation` for easier migration to `restdocs-api-spec` from MockMvc tests that use plain `spring-rest-docs-mockmvc`.
86
-
-[restdocs-api-spec-restassured](restdocs-api-spec-restassured) - contains a wrapper for `RestAssuredRestDocumentation` for easier migration to `restdocs-api-spec` from [Rest Assured](http://rest-assured.io) tests that use plain `spring-rest-docs-restassured`.
87
86
-[restdocs-api-spec-gradle-plugin](restdocs-api-spec-gradle-plugin) - adds a gradle plugin that aggregates the `resource.json` files produced by `ResourceSnippet` into an API specification file for the whole project.
88
87
89
88
### Build configuration
@@ -94,7 +93,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
94
93
* Using the [plugins DSL](https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block):
95
94
```groovy
96
95
plugins {
97
-
id 'com.epages.restdocs-api-spec' version '0.18.2'
96
+
id 'com.epages.restdocs-api-spec' version '0.XX.X'
98
97
}
99
98
```
100
99
Examples with Kotlin are also available [here](https://plugins.gradle.org/plugin/com.epages.restdocs-api-spec)
@@ -110,7 +109,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
@@ -119,7 +118,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
119
118
```
120
119
2. Add required dependencies to your tests
121
120
* *2.1* add the `mavenCentral` repository used to resolve the `com.epages:restdocs-api-spec` module of the project.
122
-
* *2.2* add the actual `restdocs-api-spec-mockmvc` dependency to the test scope. Use `restdocs-api-spec-restassured` if you use `RestAssured` instead of `MockMvc`.
121
+
* *2.2* add the actual `restdocs-api-spec-mockmvc` dependency to the test scope.
123
122
* *2.3* add configuration options for `restdocs-api-spec-gradle-plugin`. See [Gradle plugin configuration](#gradle-plugin-configuration)
124
123
```groovy
125
124
@@ -129,7 +128,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
This will do exactly what `MockMvcRestDocumentation.document` does.
299
298
Additionally it will add a `ResourceSnippet` with the descriptors you provided in the `RequestFieldsSnippet`, `ResponseFieldsSnippet`, and `LinksSnippet`.
300
299
301
-
#### RESTAssured based tests
302
-
303
-
AlsoforRESTAssured we offer a convenience wrapper similar to `MockMvcRestDocumentationWrapper`.
304
-
The usage forRESTAssured is also similar to MockMVC, except that [com.epages.restdocs.apispec.RestAssuredRestDocumentationWrapper](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apispec/RestAssuredRestDocumentationWrapper.kt) is used instead of [com.epages.restdocs.apispec.MockMvcRestDocumentationWrapper](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apispec/MockMvcRestDocumentationWrapper.kt).
305
-
306
-
To use the `RestAssuredRestDocumentationWrapper`, you have to add a dependency to [restdocs-api-spec-restassured](restdocs-api-spec-restassured) to your build.
0 commit comments