Skip to content

Commit

Permalink
[jmeter] Fix exception when operationId has $ (#17125)
Browse files Browse the repository at this point in the history
* fix exception when operationId has $ in jmeter

* add tests
  • Loading branch information
wing328 committed Nov 18, 2023
1 parent 4bedeef commit 8258cde
Show file tree
Hide file tree
Showing 13 changed files with 1,003 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generatorName: jmeter
outputDir: samples/client/petstore/jmeter
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/jmeter/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/jmeter-client
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ public void preprocessOpenAPI(OpenAPI openAPI) {
}
}

@Override
public String toOperationId(String operationId) {
// replace $ with _
return super.toOperationId(operationId.replace("$", "_"));
}

/**
* Escapes a reserved word as defined in the `reservedWords` array. Handle escaping
* those terms here. This logic is only called if a variable matches the reserved words
Expand Down
Loading

0 comments on commit 8258cde

Please sign in to comment.