Skip to content

Feature Request: copy response to clipboard #4300

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

Closed
charlescapps opened this issue Mar 7, 2018 · 1 comment · Fixed by #5278
Closed

Feature Request: copy response to clipboard #4300

charlescapps opened this issue Mar 7, 2018 · 1 comment · Fixed by #5278

Comments

@charlescapps
Copy link
Contributor

Summary

After doing a request, it would be useful if there was a clipboard icon next to the response body that could copy the response body to the clipboard.

For large response bodies, it's quite tedious to try to select it all, cmd/ctrl+a tends to select the entire page.

For our use cases, we often copy the response from 1 request, and then paste it into some other tool (e.g. GeoJSON editing), or use it as the request body to another request (e.g. a PUT request to update something.)

Q A
Bug or feature request? feature request
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.9.3
How did you install Swagger-UI? We use the static files, and just modify the javascript in index.html to change the settings as needed.
Which browser & version? Chrome...latest
Which operating system? Mac OS

Demonstration API definition

n/a

Configuration (browser query string, constructor, config.yaml)

n/a

Expected Behavior

There is a clipboard icon that you can click to copy the response received into the operating system's clipboard.

Current Behavior

There is no such icon

Possible Solution

  • This could be configurable so that it's not "always on"
  • Could fix ctrl/cmd+a so that it selects just the response body if the cursor is inside the response body

Context

This feature would make it much easier to interact with the responses from Swagger UI in various ways.

@magnusbakken
Copy link

This would be very helpful.

As a workaround (at least with Chrome/Windows) you can select the first part of the response, scroll to the bottom, and shift click on the last part of the response, then copy with Ctrl + C.

tim-lai added a commit that referenced this issue Jun 15, 2020
* Move next to download button and match styling

Co-authored-by: Aldrin Abastillas <[email protected]>
Co-authored-by: Tim Lai <[email protected]>
mattyb678 pushed a commit to mattyb678/swagger-ui that referenced this issue Jun 24, 2020
* Move next to download button and match styling

Co-authored-by: Aldrin Abastillas <[email protected]>
Co-authored-by: Tim Lai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants