Bishwas-py / djapy

No bullshit, Django Rest API Framework
https://djapy.io
59 stars 3 forks source link

Accept `constr` as query type #8

Closed Bishwas-py closed 4 months ago

Bishwas-py commented 5 months ago
@djapify
@djapy_method("POST")
@csrf_exempt
def long_tail_keyword(_r, data: TagsInput, app: constr(min_length=1)) -> dict:
    return {
        'keywords': get_serp_data(data.keyword)
    }

app: constr(min_length=1) places the string to data/payload type, it should be query.

Bishwas-py commented 4 months ago

It's fixed. But if you wanna continue use constr as payload use this:

9