Skip to content

Conversation

michaelandresen
Copy link
Contributor

Description

This pull request addresses issue #1199 (URIError when entering percent sign (%) in API Explorer) by wrapping the decodeURI call in a try-catch block to gracefully handle malformed input.

Motivation and Context

Without this fix, the API Explorer crashes when a percent sign (%) is entered in query or path parameters. Additionally, entering the string "null" in path parameters also causes a crash. This update ensures the application remains stable when encountering such inputs.

How Has This Been Tested?

  • Entering % in query or path parameters previously caused a crash — now handled safely.
  • Entering "null" in path parameters previously caused a crash — now handled safely.

Types of Changes

  • ✅ Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

}
}

// Handle boolean values
Copy link
Contributor Author

@michaelandresen michaelandresen Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explanation: decodedValue is a constant value defined in Line 58 an therefore of type "string".

Copy link

github-actions bot commented Jul 9, 2025

Visit the preview URL for this PR (updated for commit c3972d5):

https://docusaurus-openapi-36b86--pr1202-u6e79h4f.web.app

(expires Fri, 08 Aug 2025 21:45:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@blindaa121
Copy link
Collaborator

Thanks for the fix @michaelandresen! Looks good to me 👍

@blindaa121 blindaa121 merged commit 3e27346 into PaloAltoNetworks:main Jul 9, 2025
9 of 10 checks passed
dsuket pushed a commit to dsuket/docusaurus-openapi-docs that referenced this pull request Oct 13, 2025
Co-authored-by: Michael Andresen <michael.andresen@dataport.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants