slopjong / angular-jsoneditor

Angular JSOn editor
https://slopjong.github.io/angular-jsoneditor
1 stars 1 forks source link

Discussion with @davisford #4

Open slopjong opened 10 years ago

slopjong commented 10 years ago

@davisford is interested in the json editor, see angular-ui/ui-ace/issues/37

Slopjong says

the angular json editor has schema support, it's more than just writing bare json. If you specify a schema file and disable the text editor people can compose a json with the tree editor by adding the fields in a certain level that are supposed to be added on that one. The example you saw has a default schema loaded but e.g. on the spaceapi page this schema will be loaded in the future so that endpoint maintainers are much faster in adding new fields while a certain quality is guaranteed. Wrong endpoint implementations lead to bug reports which are none.

Davis says

Cool -- I have an immediate need for json schemas, but on the server side; I'm using Apache Avro -- have you looked at Avro? It works quite well, language independent, and has binary compression support -- but probably not much use in an Angular environment. I want to take a look at the angular json editor, it may prove useful in some capacity on a project I'm working on, and perhaps I can send some PRs.

slopjong commented 10 years ago

I don't know Avro. The last release includes a somewhat dirty implemented nosync feature which I needed for @spaceapi. I decided to push that hack to the master branch to allow a quick deployment of a sub-project there. Though things have become too complicated in the json editor because of the cyclic synchronization of the json string, the object representation and the abstract syntax tree. I will break up the cycle and only do the json > object > ast sync in the future. That improves the readability a lot and reduces the code size at the same time.

slopjong commented 10 years ago

Let me know what schema implementation you chose and what version you're using. I'm using json-schema.org draft-03 but without support of references as of now.

davisford commented 10 years ago

Avro has it's own schema definition / spec -- don't know if it is compatible with json-schema.org or not.

slopjong commented 10 years ago

They're incompatible but Avro provides a mapping so that it should be possible to parse Avro schemas.

If you're writing a mapper i'd add a new option schema-type so one can specify what schema implementation is actually used. However, Avro is relying on references which are currently not supported yet.

Can we have a chat some day to discuss your exact use case with avro?