Hi,
The specification requires that the JSON data is a single object { }, not a list array [ ].
So far I am not able to setup the APIView to render JSON data as an object { }.
The ListAPIView always serializes the JSON to an array and not a single object. However, RetrieveAPIView serializes the JSON as a single object.
A sample of the Roku JSON feed:
I am fairly new to this, and learning as I go.
code:
```
class RokuContentFeedAPI(APIView):
def get(self, request, format=None):
feed = RokuContentFeed.objects.all().filter(is_public=True)
serializer = RokuContentFeedSerializer(feed, many=True)
return Response(serializer.data)
```
```
class RokuContentFeedSerializer(serializers.ModelSerializer):
providerName = serializers.CharField(source='provider_name')
language = serializers.StringRelatedField()
rating = RatingSerializerList()
lastUpdated = serializers.DateTimeField(source='last_updated')
movies = MovieSerializerList(many=True)
liveFeeds = LiveFeedSerializerList(many=True, source='live_feeds')
series = SeriesSerializerList(many=True)
shortFormVideos = ShortFormVideoSerializerList(many=True, source='short_form_videos')
tvSpecials = TVSpecialSerializerList(many=True, source='tv_specials')
categories = CategorySerializerList(many=True)
playlists = PlaylistSerializerList(many=True)
class Meta:
model = RokuContentFeed
#read_only_fields = ['is_public']
fields = ['providerName', 'language', 'rating', 'lastUpdated', 'movies', \
'liveFeeds', 'series', 'shortFormVideos', 'tvSpecials', 'categories', 'playlists']
```
Thank for any suggestions
AC