+ private static JSONObject processTopData(final String filename, final JSONObject models, final SchemaNode schemaNode) {
+ final JSONObject items = new JSONObject();
+
+ items.put(REF_KEY, filename);
+ final JSONObject dataNodeProperties = new JSONObject();
+ dataNodeProperties.put(TYPE_KEY, schemaNode instanceof ListSchemaNode ? ARRAY_TYPE : OBJECT_TYPE);
+ dataNodeProperties.put(ITEMS_KEY, items);
+
+ dataNodeProperties.putOpt(DESCRIPTION_KEY, schemaNode.getDescription());
+ final JSONObject properties = new JSONObject();
+ properties.put(schemaNode.getQName().getLocalName(), dataNodeProperties);
+ final JSONObject finalChildSchema = getSchemaTemplate();
+ finalChildSchema.put(TYPE_KEY, OBJECT_TYPE);
+ finalChildSchema.put(PROPERTIES_KEY, properties);
+ finalChildSchema.put(ID_KEY, filename + OperationBuilder.TOP);
+ models.put(filename + OperationBuilder.TOP, finalChildSchema);
+
+ return dataNodeProperties;
+ }
+