From a0c5d59e009b32fcf7355dc02aed00473dd3f299 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Mon, 11 May 2020 15:16:01 -0500 Subject: [PATCH] [api] Fixes for swagger I had to introduce these changes to fix exceptions raised by swagger. --- openwisp_network_topology/api/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openwisp_network_topology/api/views.py b/openwisp_network_topology/api/views.py index 535b3b9b..4a685164 100644 --- a/openwisp_network_topology/api/views.py +++ b/openwisp_network_topology/api/views.py @@ -4,9 +4,14 @@ BaseNetworkGraphView, BaseReceiveTopologyView, ) +from django_netjsongraph.api.serializers import NetworkGraphSerializer from ..models import Snapshot, Topology +# TODO: use swappable model loading to define this at serializer level +NetworkGraphSerializer.Meta.model = Topology +NetworkGraphSerializer.Meta.fields = '__all__' + class NetworkCollectionView(BaseNetworkCollectionView): queryset = Topology.objects.filter(published=True)