label-studio-ml-backend
label-studio-ml-backend copied to clipboard
Event received without payload raise an exception
Hello,
Via Labelstudio frontend, we can choose whether to send or not the payload when the webhook is triggered:
When we deactivate the option of sending the payload, this raises an exception in the api:
https://github.com/HumanSignal/label-studio-ml-backend/blob/e4c579216a74b74ff19d73f46827b3696db6651a/label_studio_ml/api.py#L91
project_id = str(data['project']['id'])
label_config = data['project']['label_config']
This looks normal, because according to the documentation:
(Optional) Select whether to send a payload with the event. By default, payloads are sent. If you don’t send a payload, only the action key is sent. For example, choose to send the payload for Annotation created events to update the correct pipeline based on the project ID sent in the payload. Which basically means that "project" won't be find in data.
How should we handle this? Should it be the backend api that should send a minimal payload (including project_id and label_config), or should it be the ML backend that should work around the fact that a Model can be created without project_id?
Kind regards