-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[ K6 Generator ] Support for extracting examples defined at parameter level of Swagger/OpenAPI specification, plus minor fixes #9750
Changes from 2 commits
bf6b218
5ea2dd0
c32657a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.0.0-SNAPSHOT | ||
5.2.0-SNAPSHOT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: 5.0.0-SNAPSHOT | ||
* OpenAPI generator version: 5.2.0-SNAPSHOT | ||
*/ | ||
|
||
|
||
|
@@ -39,7 +39,7 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/pet/findByStatus", () => { | ||
let status = "TODO_EDIT_THE_STATUS"; | ||
let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The extra indentation in the template is reflected here, which I think is unnecessary. |
||
let url = BASE_URL + `/pet/findByStatus?status=${status}`; | ||
// Request No. 1 | ||
let request = http.get(url); | ||
|
@@ -49,7 +49,7 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/pet/findByTags", () => { | ||
let tags = "TODO_EDIT_THE_TAGS"; | ||
let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
let url = BASE_URL + `/pet/findByTags?tags=${tags}`; | ||
// Request No. 1 | ||
let request = http.get(url); | ||
|
@@ -59,7 +59,7 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/pet/{petId}", () => { | ||
let petId = "TODO_EDIT_THE_PETID"; | ||
let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
let url = BASE_URL + `/pet/${petId}`; | ||
// Request No. 1 | ||
let request = http.get(url); | ||
|
@@ -81,7 +81,7 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/pet/{petId}/uploadImage", () => { | ||
let petId = "TODO_EDIT_THE_PETID"; | ||
let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
let url = BASE_URL + `/pet/${petId}/uploadImage`; | ||
// Request No. 1 | ||
// TODO: edit the parameters of the request body. | ||
|
@@ -115,7 +115,7 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/store/order/{orderId}", () => { | ||
let orderId = "TODO_EDIT_THE_ORDERID"; | ||
let orderId = 'TODO_EDIT_THE_ORDERID'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
let url = BASE_URL + `/store/order/${orderId}`; | ||
// Request No. 1 | ||
let request = http.get(url); | ||
|
@@ -161,8 +161,8 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/user/login", () => { | ||
let password = "TODO_EDIT_THE_PASSWORD"; | ||
let username = "TODO_EDIT_THE_USERNAME"; | ||
let password = 'TODO_EDIT_THE_PASSWORD'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I'm wrong, but I expect these values to be filled with examples? Or is it another example script altogether? If so, please regenerate that example alongside this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Thank you for the feedback. My IDE does not understand mustache (yet), so apologies for the indentation problems; I’ll fix it ASAP. Regarding the Whether There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wing328 Any comments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We usually keep it as it's and create a new one based on it with more edge cases per generator. |
||
let url = BASE_URL + `/user/login?username=${username}&password=${password}`; | ||
// Request No. 1 | ||
let request = http.get(url); | ||
|
@@ -181,7 +181,7 @@ export default function() { | |
sleep(SLEEP_DURATION); | ||
}); | ||
group("/user/{username}", () => { | ||
let username = "TODO_EDIT_THE_USERNAME"; | ||
let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec | ||
let url = BASE_URL + `/user/${username}`; | ||
// Request No. 1 | ||
let request = http.get(url); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this doesn't need the extra indentation.