New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON Schema for JSON diagram config #81
Comments
Hello @ceckoslab Here is it: const schema2 = {
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"address": {
"type": "object",
"properties": {
"street_address": { "type": "string" },
"city": { "enum": ["Washington", "New-York"] },
"state": { "type": "string" }
},
"required": ["street_address", "city", "state"]
}
},
"type": "object",
"properties": {
"billing_address": { "$ref": "#/definitions/address" },
"shipping_address": { "$ref": "#/definitions/address" }
}
};
const json2 = {
"shipping_address": {
"street_address": "1600 Pennsylvania Avenue NW",
"city": null,
"state": "DC"
},
"billing_address": {
"street_address": "1st Street SE",
"city": null,
"state": "DC"
}
};
const options = {
schema: schema2,
mode: 'tree',
modes: ['code', 'text', 'tree', 'preview'],
};
const container = document.getElementById('jsoneditor');
const editor = new JSONEditor(container, options, json2); As seen from provided screenshot the editor proceed schema although fails to generate selectbox There is a bug filled out - josdejong/jsoneditor#473 |
Hello @korzol It looks good and I think that we can continue even with the glitch you've described about the Select box. I played a bit the JSON editor. I see some missing control icons, could we add them? Also could we make the popup higher and wider in order to have more visible space where we can write? |
Okay, thanks for update.
Yes, of course, I will do it in the morning. Although what control icons you mean? |
* Intermediate commit. Already setup editor and part of schema * Add outstanding json editor files * Intermediate commit. Done with schema * JSON validation & save * Outstanding icons for JSON editor * Fix: remove JSON data and leave structure only
Hello @korzol
After we finish with #56 we will implement JSON schema validation and autocomplete.
I did some research and I found this project that looks really promising: https://github.com/josdejong/jsoneditor
We will start with static hardcoded JSON schema but in another ticket we will think how we can make the schema dynamic based on what metrics we have.
The text was updated successfully, but these errors were encountered: