Reputation: 198
I have defined a concept in my model file. It looks like this
concept DoctorSchedule {
o Boolean AM12to1 optional
o Boolean AM1to2 optional
o Boolean AM2to3 optional
o Boolean AM3to4 optional
o Boolean AM4to5 optional
o Boolean AM5to6 optional
o Boolean AM6to7 optional
o Boolean AM7to8 optional
o Boolean AM8to9 optional
o Boolean AM9to10 optional
o Boolean AM10to11 optional
o Boolean AM11to12 optional
o Boolean PM12to1 optional
}
participant Doctor identified by doctorID {
o String doctorID
o String contact
o DoctorSchedule doctorSchedule
}
When I test it on the composer-playground, and try to add a new doctor participant. The JSON preview looks something like this
{
"$class": "org.acme.Doctor",
"doctorID": "0624",
"contact": "",
"doctorSchedule": {
"$class": "org.acme.DoctorSchedule",
"AM12to1": false,
"AM1to2": false,
"AM2to3": false,
"AM3to4": false,
"AM4to5": false,
"AM5to6": false,
"AM6to7": false,
"AM7to8": false,
"AM8to9": false,
"AM9to10": false,
"AM10to11": false,
"AM11to12": false,
"PM12to1": false,
}}
But when I generate the composer-rest-server and try to add a doctor using the post method, an additional id field appears
{
"$class": "org.acme.Doctor",
"doctorID": "stri1ng",
"contact": "string",
"doctorSchedule": {
"$class": "org.acme.DoctorSchedule",
"AM12to1": true,
"AM1to2": true,
"AM2to3": true,
"AM3to4": true,
"AM4to5": true,
"AM5to6": true,
"AM6to7": true,
"AM7to8": true,
"AM8to9": true,
"AM9to10": true,
"AM10to11": true,
"AM11to12": true,
"PM12to1": true,
"id": "string"
}}
What is this id field inside the DoctorSchedule concept? According to my understanding, you don't need an ID to identify a concept (like with assets or participants.) And why is this id field appearing in the composer-rest-server and not on the composer-playground?
Note: The post method throws an error if this id is a blank string.
Upvotes: 0
Views: 113
Reputation: 5570
I think you have found a bug in the REST server - I have added this new issue: 3963 whilst investigating your problem I also discovered a related problem and created a 2nd issue: 3962
My experience differs from yours in that I can leave the extra id field empty - which you obviously can't do with the DoctorID.
Upvotes: 1