Currently drf-yasg (from which were migrating) adds minLength: 1 to schema if field is not required and has default value, ie
depth = serializers.CharField(required=False, default='2')
and this generates schema
- name: depth
in: query
required: false
type: string
default: '2'
minLength: 1
which means user CAN NOT make request api.foo.com?depth=''
drf-spectacular does not add minLength value for this
- in: query
name: depth
schema:
type: string
default: '2'
This minLength: 1 value should come from allow_blank attr that for CharField default to False
Currently drf-yasg (from which were migrating) adds
minLength: 1to schema if field is notrequiredand hasdefaultvalue, ieand this generates schema
which means user CAN NOT make request
api.foo.com?depth=''drf-spectacular does not add
minLengthvalue for thisThis
minLength: 1value should come fromallow_blankattr that forCharFielddefault toFalse