-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Labels
Good first issueP3pull-request-welcomeIf a PR were to be made, we would help get it mergedIf a PR were to be made, we would help get it mergedtype: bug
Description
Q&A (please complete the following information)
- OS: Windows 11
- Browser: chrome
- Version: 138.0.7204.169
- Method of installation: springdoc-openapi
- Swagger-UI version: 5.21.0
- Swagger/OpenAPI version: Swagger 2.2.30, OpenAPI 3.0
Content & configuration
Swagger-UI configuration options (request snippets enabled):
requestSnippetsEnabled: trueDescribe the bug you're encountering
The vertical bar character | in the cURL (CMD) request body of the request snippet is not escaped. When running the generated CMD command, the first string after the | is considered a command.
To reproduce...
Steps to reproduce the behavior:
- Enable request snippets
- Construct a "Try it out" request with a JSON request body having the vertical bar/pipe character
| - Execute the request and copy the generated
cURL (CMD)snippet into a Windows cmd.exe - The
|character is not escaped which leads to a'some-string' is not recognized as an internal or external command, operable program or batch file.error message in CMD
Expected behavior
The vertical bar character | in the request body of CMD curl snippets is escaped (with a caret ^)
Screenshots
Metadata
Metadata
Assignees
Labels
Good first issueP3pull-request-welcomeIf a PR were to be made, we would help get it mergedIf a PR were to be made, we would help get it mergedtype: bug


