Skip to content

Commit

Permalink
[fix] Fix delete http verb (the k6 equivalent is del) (#6624)
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Jun 11, 2020
1 parent f373f20 commit 3b9cb14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Expand Up @@ -143,7 +143,8 @@ static class HTTPRequest {

public HTTPRequest(String method, String path, @Nullable List<Parameter> query, @Nullable HTTPBody body,
@Nullable HTTPParameters params, @Nullable List<k6Check> k6Checks) {
this.method = method;
// NOTE: https://k6.io/docs/javascript-api/k6-http/del-url-body-params
this.method = method.equals("delete") ? "del" : method;
this.path = path;
this.query = query;
this.body = body;
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/k6/.openapi-generator/VERSION
@@ -1 +1 @@
4.3.0-SNAPSHOT
5.0.0-SNAPSHOT
10 changes: 5 additions & 5 deletions samples/client/petstore/k6/script.js
@@ -1,13 +1,13 @@
/*
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://github.com/OpenAPITools/openapi-generator
*
* OpenAPI generator version: 4.3.0-SNAPSHOT
* OpenAPI generator version: 5.0.0-SNAPSHOT
*/


Expand Down Expand Up @@ -77,7 +77,7 @@ export default function() {

// Request No. 3
params = {headers: {"api_key": `${apiKey}`}};
request = http.delete(url, params);
request = http.del(url, params);
sleep(SLEEP_DURATION);
});
group("/pet/{petId}/uploadImage", () => {
Expand Down Expand Up @@ -125,7 +125,7 @@ export default function() {
sleep(SLEEP_DURATION);

// Request No. 2
request = http.delete(url);
request = http.del(url);
sleep(SLEEP_DURATION);
});
group("/user", () => {
Expand Down Expand Up @@ -198,7 +198,7 @@ export default function() {
sleep(SLEEP_DURATION);

// Request No. 3
request = http.delete(url);
request = http.del(url);
sleep(SLEEP_DURATION);
});
}

0 comments on commit 3b9cb14

Please sign in to comment.