From 3a1681357cf77017fb8be7cfc17ca3119394681c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Fri, 31 Mar 2023 15:51:25 +0200 Subject: [PATCH] Fix PathVariable reference documentation code snippets Closes gh-30258 --- src/docs/asciidoc/web/webflux.adoc | 6 +++--- src/docs/asciidoc/web/webmvc.adoc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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) { // ... }