My model expects two fields, and I validate my endpoint with that model:
config_model = api.model('Configuration', {
'cuvettes_count': fields.Integer,
'pipettes_count': fields.Integer
})
# later
class ConfigEndpoint(Resource):
@config_endpoint.expect(config_model, validate=True)
def put(self):
How do I:
- Raise a validation error if a key besides the two specified is present
- Raise a validation error if neither of the keys are present, but only require one at a time