diff --git a/src/docs/asciidoc/web/webflux.adoc b/src/docs/asciidoc/web/webflux.adoc index 5a0394c934e..fface43651c 100644 --- a/src/docs/asciidoc/web/webflux.adoc +++ b/src/docs/asciidoc/web/webflux.adoc @@ -1625,7 +1625,7 @@ content types that a controller method produces, as the following example shows: ---- @GetMapping("/pets/{petId}", produces = ["application/json"]) @ResponseBody - fun getPet(@PathVariable String petId): Pet { + fun getPet(@PathVariable petId: String): Pet { // ... } ---- @@ -1674,7 +1674,7 @@ You can also use the same with request header conditions, as the following examp [source,java,indent=0,subs="verbatim,quotes",role="primary"] .Java ---- - @GetMapping(path = "/pets", headers = "myHeader=myValue") // <1> + @GetMapping(path = "/pets/{petId}", headers = "myHeader=myValue") // <1> public void findPet(@PathVariable String petId) { // ... } @@ -1684,7 +1684,7 @@ You can also use the same with request header conditions, as the following examp [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] .Kotlin ---- - @GetMapping("/pets", headers = ["myHeader=myValue"]) // <1> + @GetMapping("/pets/{petId}", headers = ["myHeader=myValue"]) // <1> fun findPet(@PathVariable petId: String) { // ... } diff --git a/src/docs/asciidoc/web/webmvc.adoc b/src/docs/asciidoc/web/webmvc.adoc index 7086f403a96..766747c1bc1 100644 --- a/src/docs/asciidoc/web/webmvc.adoc +++ b/src/docs/asciidoc/web/webmvc.adoc @@ -1911,7 +1911,7 @@ You can also use the same with request header conditions, as the following examp [source,java,indent=0,subs="verbatim,quotes",role="primary"] .Java ---- - @GetMapping(path = "/pets", headers = "myHeader=myValue") // <1> + @GetMapping(path = "/pets/{petId}", headers = "myHeader=myValue") // <1> public void findPet(@PathVariable String petId) { // ... } @@ -1921,7 +1921,7 @@ You can also use the same with request header conditions, as the following examp [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] .Kotlin ---- - @GetMapping("/pets", headers = ["myHeader=myValue"]) // <1> + @GetMapping("/pets/{petId}", headers = ["myHeader=myValue"]) // <1> fun findPet(@PathVariable petId: String) { // ... }