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)
When an object type is an array, for instance
"type": ["string","integer"]
The conversion fails with this stackThis line doesn't handle the array case:
Note this case of type is conform to json schema type definition (at least in json schema draft v7):