3 ms·
Instead of inventing your own DSL for filtering, there are also some well-specified standards. ODATA [1] is probably the main one, and it’s adopted by e.g. Mic
by sophiabits 3y ago
Instead of inventing your own DSL for filtering, there are also some well-specified standards.
ODATA [1] is probably the main one, and it’s adopted by e.g. Microsoft’s Azure APIs. JSON:API [2] is another, although I’ve never seen it used anywhere personally.
They’re both pretty heavy specifications so I’ve never bothered implementing anything that 100% follows them. But I have picked bits and pieces from time to time—in particular ODATA’s idea for filtering is nice and comprehensive imo, and there are a number of libraries in various languages which handle parsing its filter strings into structured data.
[1] https://www.odata.org/ https://www.odata.org/
[2] https://jsonapi.org/ https://jsonapi.org/
- Exoristos 3y agoI use JSON:API, a little simplified. It works great.
- JUNGLEISMASSIVE 3y ago[dead]