From 2b427efe7f9ac3be1b0e1a74b23c3fde882a546a Mon Sep 17 00:00:00 2001 From: 1993heqiang <531364804@qq.com> Date: Thu, 30 Mar 2023 22:46:18 +0800 Subject: [PATCH] Fix PathVariable reference documentation code snippets Closes gh-30243 --- framework-docs/src/docs/asciidoc/web/webflux.adoc | 6 +++--- framework-docs/src/docs/asciidoc/web/webmvc.adoc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework-docs/src/docs/asciidoc/web/webflux.adoc b/framework-docs/src/docs/asciidoc/web/webflux.adoc index 8d2214673f..1bc6f9dabc 100644 --- a/framework-docs/src/docs/asciidoc/web/webflux.adoc +++ b/framework-docs/src/docs/asciidoc/web/webflux.adoc @@ -1655,7 +1655,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 { // ... } ---- @@ -1704,7 +1704,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) { // ... } @@ -1714,7 +1714,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/framework-docs/src/docs/asciidoc/web/webmvc.adoc b/framework-docs/src/docs/asciidoc/web/webmvc.adoc index fee3f1ccf0..2e10ae6abb 100644 --- a/framework-docs/src/docs/asciidoc/web/webmvc.adoc +++ b/framework-docs/src/docs/asciidoc/web/webmvc.adoc @@ -1903,7 +1903,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) { // ... } @@ -1913,7 +1913,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) { // ... }