Skip to content

fix(curl-cmd): escape pipe character in Windows CMD snippets#10754

Open
Dxboy266 wants to merge 1 commit intoswagger-api:masterfrom
Dxboy266:fix-10540-cmd-pipe-escape
Open

fix(curl-cmd): escape pipe character in Windows CMD snippets#10754
Dxboy266 wants to merge 1 commit intoswagger-api:masterfrom
Dxboy266:fix-10540-cmd-pipe-escape

Conversation

@Dxboy266
Copy link

@Dxboy266 Dxboy266 commented Mar 5, 2026

Summary

Fixes #10540 by escaping the vertical bar (|) in Windows CMD request snippets.

What changed

  • Updated CMD escaping logic to convert | to ^|.
  • Added unit tests covering pipe escaping in:
    • request body
    • URL query string
    • header values
  • Added compatibility assertion that bash/powershell snippets keep existing behavior.

Why

In Windows CMD, | is a control operator and must be escaped as ^|. Without escaping, generated snippets can execute incorrectly.

Validation

  • npm run test:unit -- --testPathPattern="curlify|cmd-escape"

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.

Vertical bar character | is not escaped in cURL (CMD) request snipped body

1 participant