Fix PathVariable reference documentation code snippets

Closes gh-30243
This commit is contained in:
1993heqiang 2023-03-30 22:46:18 +08:00 committed by Sébastien Deleuze
parent 3632bea51e
commit 2b427efe7f
2 changed files with 5 additions and 5 deletions

View File

@ -1655,7 +1655,7 @@ content types that a controller method produces, as the following example shows:
---- ----
@GetMapping("/pets/{petId}", produces = ["application/json"]) @GetMapping("/pets/{petId}", produces = ["application/json"])
@ResponseBody @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"] [source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java .Java
---- ----
@GetMapping(path = "/pets", headers = "myHeader=myValue") // <1> @GetMapping(path = "/pets/{petId}", headers = "myHeader=myValue") // <1>
public void findPet(@PathVariable String petId) { 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"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
@GetMapping("/pets", headers = ["myHeader=myValue"]) // <1> @GetMapping("/pets/{petId}", headers = ["myHeader=myValue"]) // <1>
fun findPet(@PathVariable petId: String) { fun findPet(@PathVariable petId: String) {
// ... // ...
} }

View File

@ -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"] [source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java .Java
---- ----
@GetMapping(path = "/pets", headers = "myHeader=myValue") // <1> @GetMapping(path = "/pets/{petId}", headers = "myHeader=myValue") // <1>
public void findPet(@PathVariable String petId) { 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"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
@GetMapping("/pets", headers = ["myHeader=myValue"]) // <1> @GetMapping("/pets/{petId}", headers = ["myHeader=myValue"]) // <1>
fun findPet(@PathVariable petId: String) { fun findPet(@PathVariable petId: String) {
// ... // ...
} }