SAP / ui5-manifest

This project contains the flattend json schema for the ui5 manifest.
Apache License 2.0
30 stars 9 forks source link

No error on using "ViewID" instead of "ViewId" in targets section #9

Open pubmikeb opened 4 years ago

pubmikeb commented 4 years ago

Investigation the issue https://github.com/SAP/ui5-manifest/issues/7, I've paid attention there is no error when using ViewID instead of ViewId:

"myTarget1": {
    "viewID": "target1",
    "viewLevel": 3,
    "viewName": "Target 1",
    "viewPath": "webapp.view.target1"
},
"myTarget2": {
    "viewId": "target2",
    "viewLevel": 2,
    "viewName": "Target 2",
    "viewPath": "webapp.view.target2"
}

Although JSON is a case sensitive. What's really strange, if I write ViewName instead of viewName, I'll gate an error.

Please check why schema ignores a wrong case by viewId.

P.S. BTW, if viewID appears more then 1 time in JSON, then no warning, but if viewID appears only once, then IDE returns an error and proposes viewId instead and only if "flexEnabled": true. In a case "flexEnabled": false, there is no any error for viewID even if it appears only once in the targets section of a JSON.

petermuessig commented 4 years ago

Hi @pubmikeb ,

I can confirm, that when using the flexEnabled=false the issue with the viewID isn't recognized as this property is no required property anymore and we allow additionalProperties for the targets. We made a brief check what happens if we disallow additional properties but then a lot of manifests will break.

Do you have a suggestion how to overcome this? So that we can only validate the proper case-form of the viewId property?

Thanks and best regards, Peter

pubmikeb commented 4 years ago

Hi @petermuessig,

I'm not familiar so much with JSON schemas, so I don't know what could be done in such scenario. Perhaps, within the schema there can be some or condition, which will allow several logical wing for schema validation. Just like JSDoc allows specifying a possible types of returning object.