openintegrationhub / Data-and-Domain-Models

Open Integration Hub master data models
Apache License 2.0
11 stars 5 forks source link

JSON schemas for collaboration throw syntax errors #97

Closed philecs closed 5 years ago

philecs commented 5 years ago

While validating the JSON schemas, some errors occured in several files e.g. Expecting comma or }, not string

I would suggest to use https://jsonformatter.curiousconcept.com/ to verify the JSON Schemas. Note: Please notice that the validator can not validate the references.

Examplary errors for calendarevent.json:

Checklist:

Acceptance Criteria:

philecs commented 5 years ago

@Heimig I found one more thing: "definitions" is duplicated within calendarevent.json. Should only use "definitions" once:

...
definitions":{
      "Contact":{  
         "type":"object",
         "properties":{  
            "name":{  
               "type":"string",
               "description":"Name of the contact",
               "examples":[  
                  "John Doe"
               ]
            },
            "eMail":{  
               "type":"string",
               "description":"E-mail of the contact",
               "examples":[  
                  "john.doe@email.com"
               ]
            }
         },         
         "definitions":{  
            "Calendar":{  
               "type":"object",
...

Validator does not show this, because is is syntactically correct.

Heimig commented 5 years ago

@philecs Changed the .jsons and commited my changes.

philecs commented 5 years ago

@Heimig

Changes look good to me. Just missing one more thing:

"Contacts":{  
         "type":"object",
         "properties":{  
            "name":{  
               "type":"string",
               "description":"Name of the contact",
               "examples":[  
                  "John Doe"
               ]
            },
            "eMail":{  
               "type":"string",
               "description":"E-mail of the contact",
               "examples":[  
                  "john.doe@email.com"
               ]
            },
            "Calendars":{  
               "type":"object",
               "properties":{  
                  "calendars":{  
                     "type":"string",
                     "description":"URI to the person's calendar",
                     "examples":[  
                        "http://cal.example.com/calA"
                     ]
                  },
                  "requestCalendar":{  
                     "type":"string",
                     "description":"URL to request an appointment with the person",
                     "examples":[  
                        "janedoe@example.com"
                     ]
                  },
                  "status":{  
                     "type":"string",
                     "description":"Identification of the thread",
                     "examples":[  
                        "http://www.example.com/busy/janedoe"
                     ]
                  }
               }

With this logic, calendars is not an array of calendards but one specific calendar object (UML defined that it is a 1 to n relation). If 1 to n is correct, than Calendards should be an array of objects.

Heimig commented 5 years ago

@philecs I changed "Calendars" to be definition of the "Contacts" object. Added the property "Calendars" as array to "Contacts" to reflect the change.

philecs commented 5 years ago

@Heimig Had to make some further adjustments. Check out: commits if you want to see the changes.

philecs commented 5 years ago

JSON Schemas fixed