Skip to content

URIError when entering percent sign (%) in API Explorer #1199

@michaelandresen

Description

@michaelandresen

Describe the bug

When entering a percent sign (%) in the API Explorer, the application throws a URIError: URI malformed. This seems to be caused by an unencoded or improperly handled percent character in the query parameters.

Steps to Reproduce:

Navigate to the API Explorer.

Enter a % character in a query parameter field.

Observe the error in the console.

Stack Trace

URIError: URI malformed
    at decodeURI (<anonymous>)
    at eval (webpack-internal:///.../buildPostmanRequest.js:90:30)
    at Array.map (<anonymous>)
    at setQueryParams (.../buildPostmanRequest.js:62:28)
    at buildPostmanRequest (.../buildPostmanRequest.js:504:5)
    at CodeSnippets (.../CodeSnippets/index.js:109:69)

Expected Behavior

The percent sign should be accepted as valid input and properly encoded/handled internally. The application should not crash.

Actual Behavior

The application crashes with the following stack trace:

Your Environment

docusaurus-theme-openapi-docs: 4.5.1
chrome desktop

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions