Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 2a88467

Browse files
committed
deprecation mention in docs
1 parent 08369bd commit 2a88467

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

spring-auto-restdocs-docs/other.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ Preprocessors are available for use in order to improve quality of endpoint exam
2424
- link:{core-package}/response/ArrayLimitingJsonContentModifier.java[limit JSON array length]: limits all JSON arrays to 3 items
2525

2626
For a list of standard preprocessors see link:{restdocs-package}/operation/preprocess/Preprocessors.java[Preprocessors].
27+
28+
[[deprecation]]
29+
=== Deprecation support
30+
31+
Endpoint or field will be marked as deprecated if at least one of these is present:
32+
33+
- method / field is annotated with `@Deprecated`
34+
- method's / field's Javadoc has `@deprecated` tag
35+
36+
The deprecation is only visible when using <<snippets-section,Section>> approach. Then it will be shown in the title (also visible in
37+
TOC) and description. Field's deprecation is shown in description column of request/response table.
38+
See how it looks in the link:https://htmlpreview.github.io/?https://github.com/ScaCap/spring-auto-restdocs/blob/master/spring-auto-restdocs-example/generated-docs/index.html#resources-item-resource-test-clone-item[example project].

spring-auto-restdocs-example/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
<plugins>
216216
<plugin>
217217
<artifactId>maven-gpg-plugin</artifactId>
218+
<version>1.6</version>
218219
<executions>
219220
<execution>
220221
<id>sign-artifacts</id>

spring-auto-restdocs-example/src/main/java/capital/scalable/restdocs/example/items/ItemResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void validateMetadata(@RequestBody Metadata metadata) {
244244
* <p>
245245
* An example of deprecation.
246246
*
247-
* @deprecated use something else
247+
* @deprecated create a new item instead
248248
*/
249249
@Deprecated
250250
@RequestMapping(value = "cloneItem", method = POST)

0 commit comments

Comments
 (0)