From 3bce189637e61d888f09e72ae3a214ca2e936ac0 Mon Sep 17 00:00:00 2001 From: JayHuLBL Date: Fri, 30 Aug 2024 11:00:10 -0700 Subject: [PATCH] updated schema --- json2mo/storedDefiniton.js | 4 ++-- lib/jsonquery.js | 2 +- lib/parser.js | 2 +- schema-modelica.json | 8 +++++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/json2mo/storedDefiniton.js b/json2mo/storedDefiniton.js index f1c6b3b2..f283da0b 100644 --- a/json2mo/storedDefiniton.js +++ b/json2mo/storedDefiniton.js @@ -17,8 +17,8 @@ function parse (content, rawJson = false) { }) } } else { - if (content.class_definition != null) { - content.class_definition.forEach(ele => { + if (content.stored_class_definition != null) { + content.stored_class_definition.forEach(ele => { moOutput += finalClassDefinitionParser.parse(ele, rawJson) moOutput += '\n' }) diff --git a/lib/jsonquery.js b/lib/jsonquery.js index f4553c7d..6d7d265a 100644 --- a/lib/jsonquery.js +++ b/lib/jsonquery.js @@ -27,7 +27,7 @@ function simplifyModelicaJSON (model, parseMode) { } return Object.assign( { within }, - { class_definition: claDefArr }, + { stored_class_definition: claDefArr }, { modelicaFile: model.modelicaFile }, { fullMoFilePath: model.fullMoFilePath }, { checksum: model.checksum }) diff --git a/lib/parser.js b/lib/parser.js index d7414840..ad1135e6 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -203,7 +203,7 @@ function generateCxf (jsonOutput, moFile, tempDir, prettyPrint, generateElementa */ function getInstantiatedFile (data, moFile) { const within = data.within - const claDef = data.class_definition + const claDef = data.stored_class_definition let insCla = [] claDef.forEach(function (obj) { const claLis = instantiatedClass(within, obj, moFile) diff --git a/schema-modelica.json b/schema-modelica.json index a401d2fe..7e60a515 100644 --- a/schema-modelica.json +++ b/schema-modelica.json @@ -3,8 +3,14 @@ "$id": "schema-modelica.json", "title": "JSON parsed Modelica file", "description": "Json representation of a Modelica model", - "$comment": "Version 2, 12/05/2022", + "$comment": "08/29/2024", "definitions": { + "stored_class_definitions": { + "description": "Stored class definitions", + "type": "array", + "additionalItems": false, + "items": { "$ref": "#/definitions/class_definition" } + }, "class_definition": { "description": "Class definition", "type": "array",