27 lines
936 B
Python
27 lines
936 B
Python
from rest_framework.schemas import AutoSchema
|
|
import coreapi
|
|
import coreschema
|
|
|
|
|
|
class UpdateUserSchema(AutoSchema):
|
|
def get_serializer_fields(self, path, method):
|
|
return [
|
|
coreapi.Field(
|
|
name='email',
|
|
location='form',
|
|
required=False,
|
|
schema=coreschema.String(description='Email пользователя')
|
|
),
|
|
coreapi.Field(
|
|
name='old_password',
|
|
location='form',
|
|
required=False,
|
|
schema=coreschema.String(description='Старый пароль')
|
|
),
|
|
coreapi.Field(
|
|
name='password',
|
|
location='form',
|
|
required=False,
|
|
schema=coreschema.String(description='Новый пароль')
|
|
),
|
|
] |