-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Subject: Import Failure: "Failed to construct 'URL'" Error with Valid Exported JSON
Description:
I am encountering an import error when trying to re-import a JSON file that was previously exported from DrawDB.
Error Message:
Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL
at Object.resolveUrl2 [as resolveUrl] (jsonschema.js?v=852b6613:324:39)
at Validator2.validate (jsonschema.js?v=852b6613:1138:26)
at jsonDiagramIsValid (validateSchema.js:5:26)
at loadJsonData (ImportDiagram.jsx:54:12)
at reader.onload (ImportDiagram.jsx:173:49)
Problem Details:
The JSON file was originally exported from DrawDB and has not been manually modified.
The file validates as correct JSON syntax through external validators (JSONLint).
Crucially, the JSON file contains no explicit URL fields (e.g., no url, host, ip, or linkfields), which makes the error puzzling.
The error occurs during the JSON Schema validation step (jsonschema.js), suggesting an internal validation rule may be incorrectly applied to a non-URL data field.
Steps to Reproduce:
Export a diagram to JSON from DrawDB.
Attempt to re-import the same JSON file.
The import fails with the above error.
Request:
Could you please investigate why the JSON Schema validator is attempting to parse a non-URL field as a URL? This appears to be a bug where a validation rule for "format": "uri"is being triggered by standard data.
Thank you for your assistance.