Skip to content

A request model decorator to validate the request at DRF APIView , aim is to write a library that can be configured to validate any type of request .

Notifications You must be signed in to change notification settings

AnkDos/drf-request-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

drf-request-model

A request model decorator to validate the request payload at DRF APIView

Usage :

Define your API Model like this (check constant.py for the reference):

     {
         "name" : RequestModel(data_type=str, regex=""),
         "mobile": RequestModel(data_type=int, regex="", required=False)
     }

Call the RequestModelValidator Decorator on the APIView methods to validate the API request on the basis of above model. Example attaced for the reference.

About

A request model decorator to validate the request at DRF APIView , aim is to write a library that can be configured to validate any type of request .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages