Closed pyby closed 5 years ago
After our requests, The team also updated all "list" end points:
We changed the API-Design. When a requested domain object contains a list without items the object will now be serialized with an empty list. Before we returned an empty JSON. These domain objects are concerned:
- channelList
- episodeWithMediasList
- eventConfigList
- mediaScheduledLivestreamList
- mediaList
- moduleConfigList
- searchResultListMedia
- searchResultListShow
- showCharacterList
- showList
- songList
- topicList
e.g.: https://il.srgssr.ch/integrationlayer/2.0/srf/mediaList/video/latestByTopic/1.json vs. https://il-test.srgssr.ch/integrationlayer/2.0/srf/mediaList/video/latestByTopic/1.json
Example: https://il.srgssr.ch/integrationlayer/2.0/srf/mediaList/video/latestByTopic/1.json
The changed API can be also tested on RSI test editorial requests, which has only 2 items:
https://il-test.srgssr.ch/integrationlayer/2.0/rsi/mediaList/video/editorial.json?pageSize=2
Next URL is now : https://il-test.srgssr.ch/integrationlayer/2.0/rsi/mediaList/video/editorial.json?next=4c121f9f3e50606447bc5b3de0c652c4fbb3e0c95caec9af06433f1ec96a2d3c0c1449385d864031 :
{ "mediaList" : [ ] }
I just reviewed the changes. From a code perspective everything seems fine.
The tests (run against the test IL) have issues because of many invalid URNs, but the tests related to the change pass successfully. Well, almost, since I found two potential issues:
byURNs
call, but I think that a requesting a media list for an invalid topic should return a 404.-testRecommendedMedias
for SRF returns a 402 error (payment required). I doubt this error code is valid, but this is mostly an IL issue.In the meantime, we should not close the branch.
How could we know if a topic urn is valid or not? There is no topic API, only a topic list API: http://www.srfcdn.ch/developer-docs/integrationlayer/api/public/swagger/index.html#/TopicList
Is it the role of a mediaList to returns 404 if the topic urn is invalid? After a discussion with @defagos @SebastienChauvin and @StaehliJ , we opened an issue for the Play IL team.
Issue type
Improvement
Description of the problem
IL API improved the media list by urns and show list by urns API, with no
404
response anymore.https://srfmmz.atlassian.net/browse/PLAY-758 https://srfmmz.atlassian.net/browse/PLAY-759