Skip to content

Feature Request: copy response to clipboard #4300

@charlescapps

Description

@charlescapps

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions