Releases: guess/flop_rest
Releases · guess/flop_rest
Release list
v0.6.1
Changed
- List operators with a single value (no commas) now pass through as a string instead of a single-element list. This allows Flop to apply its own parsing, such as whitespace splitting for
like_and/like_or/ilike_and/ilike_or.
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Added
- Comma-separated value parsing for list operators (
in,not_in,like_and,like_or,ilike_and,ilike_or). For example,status[in]=draft,publishedis now equivalent tostatus[in][]=draft&status[in][]=published. The bracket[]syntax still works and serves as an escape hatch for values that contain commas. - Operator reference table with SQL examples in
FlopRest.Operatorsmoduledoc.
Full Changelog: v0.5.0...v0.6.0
v0.5.0
v0.4.0
Added
FlopRest.normalize/2with:foroption for schema-aware filtering. When a schema is provided, only fields in the schema'sfilterablelist become filters. Non-filterable params are kept in the result at the root level for custom handling.FlopRest.Filters.extract/2accepts aMapSetof filterable field names and returns a{filters, extra_params}tuple.
v0.3.0
v0.2.0
Added
FlopRest.to_query/1,2to convert Flop structs back to REST-style query paramsFlopRest.build_path/2,3to build URL paths with REST-style query strings (merges with existing query params)FlopRest.Operators.to_rest/1for reverse operator mapping (Flop → REST)FlopRest.Pagination.to_rest/1for reverse pagination transformationFlopRest.Sorting.to_rest/1for reverse sorting transformationFlopRest.Filters.to_rest/1for reverse filter transformation- Accepts both
Flop.t()andFlop.Meta.t()structs
Changed
- Added
flopandplugas runtime dependencies limitalone now defaults to cursor-based pagination (first) instead of offset-based. This ensures Flop returns cursor metadata for use withstarting_after/ending_before. To use offset-based pagination, includeoffset(e.g.,offset=0&limit=25).
v0.1.1
Added
- Initial release of FlopRest
FlopRest.normalize/1to transform REST-style query params to Flop format- Filter transformation with support for:
- Bare values as equality filters (
status=published) - Nested operator syntax (
amount[gte]=100) - All Flop operators:
eq,ne,lt,lte,gt,gte,in,not_in,contains,not_contains,like,not_like,like_and,like_or,ilike,not_ilike,ilike_and,ilike_or,empty,not_empty,search - Unknown operators passed through for Flop validation
- Bare values as equality filters (
- Sorting transformation:
- Comma-separated fields (
sort=name,-created_at) -prefix for descending order+or no prefix for ascending order
- Comma-separated fields (
- Pagination support for all three Flop pagination types:
- Cursor-based (Stripe-style):
limit,starting_after,ending_before - Page-based:
page,page_size - Offset-based:
offset,limit
- Cursor-based (Stripe-style):