Skip to content
This repository was archived by the owner on Apr 12, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions iids/analyzer/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#Serializers for input
from rest_framework import serializers
from rest_framework.renderers import JSONRenderer

class EndpointSerializer(serializers.ModelSerializer):
read_only_fields = ("model_name", "param1", "param2", "param3")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will modify it as soon as the necessary changes are made



serializer = EndpointSerializer(data)
json = JSONRenderer().render(serializer.data)

#Deserializinf of data
from StringIO import StringIO
from rest_framework.parsers import JSONParser

stream = StringIO(json)
data = JSONParser().parse(stream)