Skip to content

Fix @PathVariable reference documentation code snippets #30243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions framework-docs/src/docs/asciidoc/web/webflux.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
// ...
}
----
Expand Down Expand Up @@ -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) {
// ...
}
Expand All @@ -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) {
// ...
}
Expand Down
4 changes: 2 additions & 2 deletions framework-docs/src/docs/asciidoc/web/webmvc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
// ...
}
Expand All @@ -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) {
// ...
}
Expand Down