Fix PathVariable reference documentation code snippets
Closes gh-30243
This commit is contained in:
parent
3632bea51e
commit
2b427efe7f
|
|
@ -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) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue