我正在构建一个 API 端点,并使用 Marshmallow 进行输入验证和封送处理。我想接受的对象之一有一些特定的字段,但只要字段名称以 . 开头,也会接受其他字段x-。例如:
{
"name": "Bob Paulson", // a strict, required field
"email": "bob@example.com", // a strict, required field
"x-dob": "1980-10-11" // not a part of the explicit schema but accepted because it begins with 'x-'
}
有没有办法在棉花糖中指定这个?
斯蒂芬大帝
相关分类