som-research / jsonschema-to-uml Goto Github PK
View Code? Open in Web Editor NEWA tool to generate UML class diagrams from JSON schema documents
Home Page: https://som-research.uoc.edu/research-tools/
License: Eclipse Public License 2.0
A tool to generate UML class diagrams from JSON schema documents
Home Page: https://som-research.uoc.edu/research-tools/
License: Eclipse Public License 2.0
I've tried installing in several versions of Eclipse and Eclipse with Papyrus all of them fail when I try and do JSONSchema to UML with a dialog saying Problem Occurred. The details of the error are:
An internal error occurred during:
"edu.uoc.som.jsonschematouml.ui.popup.handlers.ConvertToClassDiagram".
java.lang.NullPointerException
I've tried several different JSON Schema files. The example of one is shown below:
{
"id": "/common/core/fieldTypes/codeType_v02_00_rev001.json#",
"$schema": "http://json-schema.org/draft-03/schema#",
"title": "Code",
"description": "The code for the related entity. If this is a coded value, codeValue and shortName should be used. If this is just a string value, only shortName is necessary",
"type": "object",
"additionalProperties": false,
"properties": {
"codeValue": {
"description": "The code for the related entity",
"type": "string"
},
"shortName": {
"description": "Short description of the related code",
"type": "string"
},
"longName": {
"description": "Long description of the related code",
"type": "string"
}
}
}
Hello, The project of JSON files I want to import has right at 1900 JSON files in it. Because of this iit would help significantly if the error dialog could contain information on the error such as file name, error type, line number, with file name being far and away the most helpful item.
Thanks for considering.
Hello,
im having two issues:
<?xml version="1.0" encoding="UTF-8"?> <uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_DZCE0EHBEeqcCL9vRpPMpg" name="myJSON"> <packagedElement xmi:type="uml:Package" xmi:id="_DZCE0UHBEeqcCL9vRpPMpg" name="myJSON"> <packagedElement xmi:type="uml:Class" xmi:id="_DZCE0kHBEeqcCL9vRpPMpg" name="Unknown"/> <packagedElement xmi:type="uml:Class" xmi:id="_DZCE00HBEeqcCL9vRpPMpg" name="Dpns-schema"/> </packagedElement> </uml:Model>
An internal error occurred during: "edu.uoc.som.jsonschematouml.ui.popup.handlers.ConvertToClassDiagram". java.lang.NullPointerException
I saw the solved issue with similar problem, but testValid.json should have valid URI as id.
best regards,
When an object type is an array, for instance
"type": ["string","integer"]
The conversion fails with this stack
java.lang.IllegalStateException
at com.google.gson.JsonArray.getAsString(JsonArray.java:226)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyzeProperty(JSONSchemaToUML.java:463)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyzeObject(JSONSchemaToUML.java:336)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyzeRootSchemaElement(JSONSchemaToUML.java:264)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyzeDefinitions(JSONSchemaToUML.java:754)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyzeRootSchemaElement(JSONSchemaToUML.java:269)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyzeSchema(JSONSchemaToUML.java:253)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.analyze(JSONSchemaToUML.java:219)
at edu.uoc.som.jsonschematouml.generators.JSONSchemaToUML.launch(JSONSchemaToUML.java:171)
at edu.uoc.som.jsonschematouml.ui.handlers.ConvertToClassDiagram$1.run(ConvertToClassDiagram.java:56)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
This line doesn't handle the array case:
JSONSchemaToUML.java:463
else if(itemsObject.has("type") && itemsObject.get("type").getAsString().equals("string")) {
Note this case of type is conform to json schema type definition (at least in json schema draft v7):
"type": {
"anyOf": [
{"$ref": "#/definitions/simpleTypes"},
{
"type": "array",
"items": {"$ref": "#/definitions/simpleTypes"},
"minItems": 1,
"uniqueItems": true
}
],
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.