Skip to content

Conversation

@aman-v-singh
Copy link
Contributor

  • Escape special characters to preserve their literal meaning within double quotes

@aman-v-singh aman-v-singh requested a review from VShingala April 17, 2024 04:40
@VShingala
Copy link
Member

@aman-v-singh Tests are failing. Can you fix them and request review?

Copy link
Member

@VShingala VShingala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aman-v-singh Can we add unit/newman tests cases related to this change?

@aman-v-singh aman-v-singh requested a review from VShingala April 17, 2024 17:10
Copy link
Member

@VShingala VShingala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aman-v-singh Since previous fix that we did also addresses other coddegens (see list in below PR), can we make sure that changes made to sanitize function is also addressed in other codegens?

#289

@aman-v-singh aman-v-singh requested a review from VShingala April 23, 2024 06:56
@aman-v-singh aman-v-singh changed the title Escape special characters for curl codegen Escape special characters in codegen Apr 23, 2024
Copy link
Member

@VShingala VShingala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing unit test for powershell changes. Let's also add test for it.

else {
codeSnippet += `$response = Invoke-RestMethod '${request.url.toString()}' -CustomMethod ` +
`'${request.method}' -Headers $headers`;
codeSnippet += `$response = Invoke-RestMethod '${request.url.toString().replace(/'/g, '\'\'')}' -CustomMethod ` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's separate out this .replace logic to a common function and utilise it instead of direct logic.

@aman-v-singh aman-v-singh requested a review from VShingala April 26, 2024 04:55
@aman-v-singh aman-v-singh merged commit b5116c1 into develop Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants