Fix response to more accurately follow the specification
Closed this issue · 0 comments
Issues
- Remove RoR specific items: id, created_at and updated_at
- Put data model title, like "academicSession(s)", and brace, {}.
- Ref. specification 5.1 and specification 5.2
- Error handling for no response data
- Case1: For single object
- Case2: For collection of objects
- Ref. specification 3.5
Response payload sample for "getAcademicSession"
Response (payload): Specification
{"academicSessions": [{"sourcedId":"sample-guid-1","status":null,"dateLastModified":null,"title":"2017-intensive","type":"term","startDate":"2017-04-01","endDate":"2018-03-31","parentSourcedId":null,"schoolYear":2018},{"sourcedId":"sample-guid-2","status":null,"dateLastModified":null,"title":"2017-full","type":"term","startDate":"2017-04-01","endDate":"2018-03-31","parentSourcedId":null,"schoolYear":2018}]}
Response (payload): Current status
[{"id":1,"sourcedId":"sample-guid-1","status":null,"dateLastModified":null,"title":"2017-intensive","type":"term","startDate":"2017-04-01","endDate":"2018-03-31","parentSourcedId":null,"schoolYear":2018,"created_at":"2018-10-13T08:31:29.330+09:00","updated_at":"2018-10-13T08:31:29.330+09:00"},{"id":2,"sourcedId":"sample-guid-2","status":null,"dateLastModified":null,"title":"2017-full","type":"term","startDate":"2017-04-01","endDate":"2018-03-31","parentSourcedId":null,"schoolYear":2018,"created_at":"2018-10-13T08:31:29.328+09:00","updated_at":"2018-10-13T08:31:29.328+09:00"}]