Git Product home page Git Product logo

jsonschema-to-uml's People

Contributors

jlcanovas avatar zsquirrel1009 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonschema-to-uml's Issues

Problem Occurred

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"
}
}
}

Request that error dialog give details on error.

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.

NullPointerException

Hello,
im having two issues:

  1. I have a JSON file (https://github.com/dashevo/dpns-contract/blob/v0.2-dev/src/schema/dpns-documents.json) that visualizes great with your "JSON Discoverer" but does not work at all with this eclipse plugin. Actually none of my simple examples run. They all have no header and just start with the json structure. There will be no errror and the resulting uml is just:

<?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>

  1. So it seems the eclipse plugin needs a header with "schema" and "id". But now I tested the testValid.json from your repo (https://github.com/SOM-Research/jsonSchema-to-uml/blob/master/plugins/edu.uoc.som.jsonschematouml.test/inputs/testValid.json) and this file produces NullPointerException:
    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,

IllegalStateException when type is an array

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
                }
            ],

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.