diff --git a/endpoints/trigger.py b/endpoints/trigger.py index a45588feb..240764908 100644 --- a/endpoints/trigger.py +++ b/endpoints/trigger.py @@ -594,10 +594,11 @@ class CustomBuildTrigger(BuildTrigger): def _metadata_from_payload(self, payload): try: - validate(json.loads(payload), self.payload_schema) + metadata = json.loads(payload) + validate(metadata, self.payload_schema) except: raise InvalidPayloadException() - return payload + return metadata def handle_trigger_request(self, request, trigger): payload = request.get_json()