Skip to content

feat: Allow Copying of Sample API Responses from DocumentationΒ #112

@andemosa

Description

@andemosa

Feature Request: Copy Button for Sample Responses

Description

Hi πŸ‘‹
First off, thank you for building and maintaining DummyJSON β€” it's an incredibly useful tool for prototyping and testing applications.

I'd like to suggest a small improvement to the documentation UX:

Currently, while the API endpoints and examples are well presented, there is no easy way to copy the sample JSON responses directly from the docs. This makes it slightly inconvenient when developers want to:

  • Quickly reuse sample responses for mocking
  • Create TypeScript types/interfaces
  • Test UI components with realistic data
  • Debug or inspect response structures

Proposed Improvement

Add a β€œCopy” button to sample response blocks (similar to code snippets), allowing users to copy JSON responses with one click.

Suggested Behaviour

A small copy-to-clipboard button placed at the top-right corner of each sample response block, similar to what many documentation sites already do.

Example

For sections like:

[
  {
    "slug": "beauty",
    "name": "Beauty",
    "url": "https://dummyjson.com/products/category/beauty"
  }
]

It would be helpful to have:

  • πŸ“‹ Copy button (top-right)

Benefits

  • Improves developer experience significantly
  • Saves time when building mock data or types
  • Makes the docs more interactive and modern
  • Aligns with common documentation standards

Contribution

I'd be happy to work on this feature and open a PR if it aligns with the project direction πŸ‘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions