Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated schema #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions json2mo/storedDefiniton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
})
Expand Down
2 changes: 1 addition & 1 deletion lib/jsonquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion schema-modelica.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down