Skip to content

Conversation

@khushthecoder
Copy link

This PR fixes issue #561.

The JSON import flow was crashing because the default uri format validator inside jsonschema throws a TypeError when given an empty string or a non-URL-safe value.

This patch adds a safe custom URI validator (safeUriValidator) and overrides the built-in uri format.
It allows empty strings, trims input, and returns false instead of throwing — preventing the app from crashing.

Tested locally:
✓ Export JSON
✓ Re-import JSON in a fresh editor tab
✓ No errors, import works correctly

Thanks!

@vercel
Copy link

vercel bot commented Nov 15, 2025

@khushthecoder is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1ilit
Copy link
Member

1ilit commented Nov 16, 2025

@khushthecoder can u please provide a diagram where the error occurs

@khushthecoder
Copy link
Author

@khushthecoder can u please provide a diagram where the error occurs

sure will do it in a few moments

@khushthecoder
Copy link
Author

image Hi @L1lit, As requested, I've successfully reproduced the original bug on my local machine. I ran the code from the upstream/main branch (on the bug-repro-branch) and imported the original .json file from issue #561. Here is the screenshot of the console crash (TypeError: Invalid URL). My PR correctly handles this exact error and prevents the app from crashing.

@1ilit
Copy link
Member

1ilit commented Nov 16, 2025

please export the diagram as json and attach it here

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