I noticed a problem with parsing one of my JSON structures once I pulled it over into a combined UML file (@startuml insead of @startjson). So then I took one of the examples from the plantuml website and recreated the problem. Maybe it is just two levels of objects aren't being parsed correctly?
The log:
plantuml -tsvg broken.obj
l="null": null,
l="true": true,
l="false": false,
l="JSON_Number": [-1, -1.1, "<color:green>TBC"],
l="JSON_String": "a\nb\rc\td <color:green>TBC...",
l="JSON_Object": {
l="{}": {},
l="k_int": 123,
l="k_str": "abc",
l="k_obj": {
l="k": "v"
Error net.sourceforge.plantuml.json.ParseException: Unexpected end of input at 1:209
net.sourceforge.plantuml.json.ParseException: Unexpected end of input at 1:209
at net.sourceforge.plantuml.json.JsonParser.error(JsonParser.java:493)
at net.sourceforge.plantuml.json.JsonParser.expected(JsonParser.java:487)
at net.sourceforge.plantuml.json.JsonParser.readObject(JsonParser.java:254)
at net.sourceforge.plantuml.json.JsonParser.readValue(JsonParser.java:180)
at net.sourceforge.plantuml.json.JsonParser.readObject(JsonParser.java:249)
at net.sourceforge.plantuml.json.JsonParser.readValue(JsonParser.java:180)
at net.sourceforge.plantuml.json.JsonParser.parse(JsonParser.java:155)
at net.sourceforge.plantuml.json.JsonParser.parse(JsonParser.java:94)
at net.sourceforge.plantuml.objectdiagram.command.CommandCreateJson.executeNow(CommandCreateJson.java:129)
at net.sourceforge.plantuml.objectdiagram.command.CommandCreateJson.executeNow(CommandCreateJson.java:64)
at net.sourceforge.plantuml.command.CommandMultilines2.execute(CommandMultilines2.java:111)
at net.sourceforge.plantuml.command.ProtectedCommand.execute(ProtectedCommand.java:54)
at net.sourceforge.plantuml.AbstractPSystem.executeCommand(AbstractPSystem.java:157)
at net.sourceforge.plantuml.command.PSystemCommandFactory.executeFewLines(PSystemCommandFactory.java:125)
at net.sourceforge.plantuml.command.PSystemCommandFactory.createSystem(PSystemCommandFactory.java:108)
at net.sourceforge.plantuml.PSystemBuilder.createPSystem(PSystemBuilder.java:136)
at net.sourceforge.plantuml.BlockUml.getDiagram(BlockUml.java:181)
at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:160)
at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:517)
at net.sourceforge.plantuml.Run.processArgs(Run.java:400)
at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:367)
at net.sourceforge.plantuml.Run.main(Run.java:202)
You should send a mail to plantuml@gmail.com or post to
http://plantuml.com/qa with this log (V1.2022.5)
Error line 18 in file: broken.obj
Some diagram description contains errors
Here is the file contents. Its just an example on the plantuml website but I indented k_obj:
@startuml
allowmixing
title Information Table
json fit {
"null": null,
"true": true,
"false": false,
"JSON_Number": [-1, -1.1, "<color:green>TBC"],
"JSON_String": "a\nb\rc\td <color:green>TBC...",
"JSON_Object": {
"{}": {},
"k_int": 123,
"k_str": "abc",
"k_obj": {
"k": "v"
}
},
"JSON_Array" : [
[],
[true, false],
[-1, 1],
["a", "b", "c"],
["mix", null, true, 1, {"k": "v"}]
]
}
@enduml