codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.69k stars 2.08k forks source link

Json Schema #1026

Closed jaumemilian closed 4 years ago

jaumemilian commented 4 years ago

Hi,

Do you have any official Json Schema document in order to validate the Json that is provided by the tool?

Thanks, Jaume

Farrien commented 4 years ago

Maybe this https://github.com/editor-js/editorjs-php can help you?

gohabereg commented 4 years ago

Hi @jaumemilian

As the Editor.js core doesn't know anything about the tool's data structure, validation should be performed by the tool. You can provide validate method that is called after the save method.

However, I think it is a good idea to provide some final validation, but requires further discussion

jaumemilian commented 4 years ago

Thanks @gohabereg for the response,

In our case, we use the tool from front, but as we expose a public API to store the documents we also are validating in back the format of the document.

Of course, that validation is not part of our Application/Domain layer, but it is set in the Infrastructure layer.

We have created our own JsonSchema to validate

Kind regards, Jaume