This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
#import pprint | |
import os | |
''' | |
Assuming that you exported your postman collection in your current path | |
or you can delete os.getcwd() and put the full path of your postman | |
collection exported file | |
''' | |
current_path=os.getcwd() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
When you're developing an Endpoint with Django Rest Framework, in some situations you'll want to re-use it for generating example data, make tests (e.g. in DRF API View, Postman, Swagger IO...) and also to use it in your web app. For that reason, you'll receive differents types of request. On way to handle with this problem, is to create a decorator method to validate the type of request and then, in your CFA or CVB call the decorator. | |
_instance= MyNameViewSet() | |
_instance.endpoint_name(request,param1=1,param2=1) | |
''' | |
# Request validation is like that: | |
from functools import wraps |