Flagsmith / Flagsmith/flagsmith

Serialise segment API responses from JSON, drop rule and condition IDs

Open
#7,817 0 comments 0 reactions 0 assignees View on GitHub
api
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

Migrate the management API read path onto `Segment.rules_data`.

We're technically breaking the API contract, but don't expect anyone to use the IDs. If we're presented with evidence to the contrary, we're going to use list indexes as IDs.

### Acceptance criteria

- Segment responses contain no `id` on rules or conditions; conditions expose `operator`, `property`, `value`, `description`.
- The segment list and retrieve endpoints no longer issue rule or condition queries for segments that have `rules_data` populated (assert query counts drop).
- For segments with no `rule_data`, list and retrieve endpoints fall back to relational data.
- OpenAPI spec and Postman collection no longer include segment rule and condition IDs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.