docs: public static Diagram parseJson(JSONObject json,
                                      Boolean keepGlossaryLink) throws JSONException {
          ArrayList<Shape> shapes = new ArrayList<Shape>();
          HashMap<String, JSONObject> flatJSON = flatRessources(json);
          for (String resourceId : flatJSON.keySet()) {
              parseRessource(shapes,
                             flatJSON,
                             resourceId,
                             keepGlossaryLink);
          }
          String id = "canvas";
  
          if (json.has("resourceId")) {
              id = json.getString("resourceId");
              shapes.remove(new Shape(id));
          }
          ;
          Diagram diagram = new Diagram(id);
  
          // remove Diagram
          // (Diagram)getShapeWithId(json.getString("resourceId"), shapes);
          parseStencilSet(json,
                          diagram);
          parseSsextensions(json,
                            diagram);
          parseStencil(json,
                       diagram);
          parseProperties(json,
                          diagram,
                          keepGlossaryLink);
          parseChildShapes(shapes,
                           json,
                           diagram);
          parseBounds(json,
                      diagram);
          diagram.setShapes(shapes);
          return diagram;
      }