-
Notifications
You must be signed in to change notification settings - Fork 17
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
Check structure of class_definition #239
Comments
@JayHuLBL Can you check if this is a bug? |
@AntoineGautier modelica-json/schema-modelica.json Line 171 in f0b714b
class_definition but change the type to object .
|
I wonder whether the following modifications would not be a better match with the grammar. Replace the definition of modelica-json/schema-modelica.json Line 8 in f0b714b
with: "definitions": {
"stored_class_definitions": {
"description": "Stored class definitions",
"type": "array",
"additionalItems": false,
"items": { "$ref": "#/definitions/class_definition" }
},
"class_definition": {
"description": "Class definition",
"type": "object",
"required": [
"class_prefixes",
"class_specifier"
],
"additionalProperties": false,
"properties": {
"final": {
"type": "boolean"
},
"encapsulated": {
"type": "boolean"
},
"class_prefixes": {
"type": "string"
},
"class_specifier": {
"$ref": "#/definitions/class_specifier"
}
}
} This way:
As part of this issue, is it also possible to fix |
@AntoineGautier Thanks for the suggestion. I will update it accordingly. |
@AntoineGautier |
@JayHuLBL In the case of short class names, I expected |
From the JSON schema at https://github.com/lbl-srg/modelica-json/blob/master/schema-modelica.json#L7-L10
class_definition
should be an array.However, when translating a Modelica file with local class definitions (such as
GreaterNoHysteresis
withinBuildings/Controls/OBC/CDL/Reals/Greater.mo
) the corresponding JSON output has the following structure, whereclass_definition
is parsed as a non-array object:In addition, the class name lookup fails for such classes.
The text was updated successfully, but these errors were encountered: