Skip to content

Commit

Permalink
Name parameter setters set* to avoid conflicts (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomboyo authored Feb 9, 2023
1 parent f1f4dac commit 4313c13
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void happyPath(WireMockRuntimeInfo info) throws Exception {
var response =
api.petsOperations() // All operations with the `pets` tag. (see also: everyOperation)
.showPetById() // The GET /pets/{petId} operation
.petId("1234") // bind "1234" to the {petId} parameter of the OAS operation
.setPetId("1234") // bind "1234" to the {petId} parameter of the OAS operation
.sendSync(); // execute the request synchronously and get a ShowPetByIdResponse object.

/* The response object is a sealed interface based on what the OAS says the API can return. In this case, the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public java.net.http.HttpRequest httpRequest() {
parameter ->
Map.of(
"fqpt", parameter.typeName().toFqpString(),
"name", parameter.name().lowerCamelCase(),
"name", "set" + parameter.name().upperCamelCase(),
"apiName", parameter.apiName(),
"encoder", getEncoder(parameter.encoding())))
.collect(toList()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void hasPathParameterSetters() {
.build()
.everyOperation()
.getPetById()
.id("1234")
.setId("1234")
.uriTemplate()
.toURI();
"""
Expand Down Expand Up @@ -159,8 +159,8 @@ void hasQueryParameterSetters() {
.build()
.everyOperation()
.listPets()
.limit(5)
.include(java.util.List.of("name", "age"))
.setLimit(5)
.setInclude(java.util.List.of("name", "age"))
.uriTemplate()
.toURI();
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ static void beforeAll() throws Exception {
.build()
.everyOperation()
.postFoo()
.id("1234")
.color("red")
.setId("1234")
.setColor("red")
.httpRequest();
"""
.formatted(packageName),
Expand Down

0 comments on commit 4313c13

Please sign in to comment.