Currently, the API returns a 500 error response when the feature_segment attribute is missing in the POST JSON. We should review
- if the FE is sending this, or if this occurrence was manually triggered against our API
- a better response to communicate the error to the client
Further details from Sentry:
Sentry Issue: FLAGSMITH-API-5PY
KeyError: 'feature_segment'
(11 additional frame(s) were not displayed)
...
File "features/versioning/views.py", line 151, in perform_create
serializer.save(
File "features/versioning/serializers.py", line 174, in create
self._validate_segment_override_limit(environment)
File "features/versioning/serializers.py", line 323, in _validate_segment_override_limit
segment_ids_to_create_overrides=self.segment_ids_to_create_overrides,
File "features/versioning/serializers.py", line 164, in segment_ids_to_create_overrides
if fs["feature_segment"] is not None
Currently, the API returns a 500 error response when the
feature_segmentattribute is missing in the POST JSON. We should reviewFurther details from Sentry:
Sentry Issue: FLAGSMITH-API-5PY