Skip to content

Commit 2b427ef

Browse files
1993heqiangsdeleuze
authored andcommitted
Fix PathVariable reference documentation code snippets
Closes gh-30243
1 parent 3632bea commit 2b427ef

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

framework-docs/src/docs/asciidoc/web/webflux.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ content types that a controller method produces, as the following example shows:
16551655
----
16561656
@GetMapping("/pets/{petId}", produces = ["application/json"])
16571657
@ResponseBody
1658-
fun getPet(@PathVariable String petId): Pet {
1658+
fun getPet(@PathVariable petId: String): Pet {
16591659
// ...
16601660
}
16611661
----
@@ -1704,7 +1704,7 @@ You can also use the same with request header conditions, as the following examp
17041704
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
17051705
.Java
17061706
----
1707-
@GetMapping(path = "/pets", headers = "myHeader=myValue") // <1>
1707+
@GetMapping(path = "/pets/{petId}", headers = "myHeader=myValue") // <1>
17081708
public void findPet(@PathVariable String petId) {
17091709
// ...
17101710
}
@@ -1714,7 +1714,7 @@ You can also use the same with request header conditions, as the following examp
17141714
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
17151715
.Kotlin
17161716
----
1717-
@GetMapping("/pets", headers = ["myHeader=myValue"]) // <1>
1717+
@GetMapping("/pets/{petId}", headers = ["myHeader=myValue"]) // <1>
17181718
fun findPet(@PathVariable petId: String) {
17191719
// ...
17201720
}

framework-docs/src/docs/asciidoc/web/webmvc.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ You can also use the same with request header conditions, as the following examp
19031903
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
19041904
.Java
19051905
----
1906-
@GetMapping(path = "/pets", headers = "myHeader=myValue") // <1>
1906+
@GetMapping(path = "/pets/{petId}", headers = "myHeader=myValue") // <1>
19071907
public void findPet(@PathVariable String petId) {
19081908
// ...
19091909
}
@@ -1913,7 +1913,7 @@ You can also use the same with request header conditions, as the following examp
19131913
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
19141914
.Kotlin
19151915
----
1916-
@GetMapping("/pets", headers = ["myHeader=myValue"]) // <1>
1916+
@GetMapping("/pets/{petId}", headers = ["myHeader=myValue"]) // <1>
19171917
fun findPet(@PathVariable petId: String) {
19181918
// ...
19191919
}

0 commit comments

Comments
 (0)