我有一个这样的模型:
my_resource_model = api.model(
RESOURCE_NAME,
'month_id': rest.fields.String,
'week_id': rest.fields.String
)
还有这样的资源:
class MyResource(Resource):
@api.expect(my_resource_model):
def post(self):
# need to require either week_id *or* month_id is present in request
如何指定两个字段都不是必需的,但必须至少传递一个?