JSON import silently discards parts of documents that are invalid
Is there an existing issue for this?
- [x] I have searched the existing issues
This is not related to configuring Outline
- [x] The issue is not related to self-hosting config
Current Behavior
When importing a json file that has a raw text node outside a paragraph, it seems large parts of the document are ignored.
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Some paragraph with some text."
}
]
},
{
"type": "text",
"text": "Wow! Such text"
}
]
}
This will get imported to an empty page with no errors of any kind.
Expected Behavior
An error message saying that it doesn't match the schema or something.
Steps To Reproduce
Import the attached file export.zip
Environment
- Outline: 0.84.0
- Browser: Firefox
Anything else?
I know the json import is somewhat internal. But it's very nice to write importers for it, as the current markdown parser is kinda limited in what it can import (no embeds, notices inside table cells, or highlighted text, for example).
Ensuring that a successful import actually means that outline understood the whole document is quite useful in my opinion.
Similarly, images that are not children of a paragraph node seem to be silently ignored.
hey @tommoor, I think we can setup some fairly simple schema validation on the backend for this. But from what I can find there is no defined schema for the imported JSON data.