gs-gs / staruml-cefact

StarUML extensions to support UN/CEFACT edi3 tools & methods specifications.
18 stars 6 forks source link

Sub-resources should only act on the sub-resource model not on the whole parent model #111

Closed onthebreeze closed 4 years ago

onthebreeze commented 4 years ago

Refs #109 Please refer to the sub-resource schema in the generated swagger. They contain the whole /applicants model instead of just the model of the referenced sub-resource.

For example, when POSTing to /applicants/{id}/travelDocuments, the body of the POST should just be the travelDocument and any contained/references classes below travelDocument and not the entire /applicants structure. This is common to all sub-resources. Same applies to GET, PUT verbs for sub-resources.

onthebreeze commented 4 years ago

checked and it appears that it almost works.

The POST /subresource, PUT /subresource/{id} and GET /subresource/{id} appear to be ok BUT GET /subresource (ie the collection) has an empty data model. it should return a collection and not an empty set.

onthebreeze commented 4 years ago

Still not right. the model shows the collection response as an object when it should be an array of objects. so for example GET /applicants/{id}/citizenships should return an array of citizenships, not a single one. Only GET /applicants/{id}/citizenships/{id} should return a single one - which it does.

faizanvahevaria commented 4 years ago

@onthebreeze Please test previous comment from the latest code

onthebreeze commented 4 years ago

tested ok