Browse Source

Fix PathVariable reference documentation code snippets

Closes gh-30243
pull/30264/head
1993heqiang 2 years ago committed by Sébastien Deleuze
parent
commit
2b427efe7f
  1. 6
      framework-docs/src/docs/asciidoc/web/webflux.adoc
  2. 4
      framework-docs/src/docs/asciidoc/web/webmvc.adoc

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

@ -1655,7 +1655,7 @@ content types that a controller method produces, as the following example shows: @@ -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 @@ -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 @@ -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) {
// ...
}

4
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 @@ -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 @@ -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) {
// ...
}

Loading…
Cancel
Save