Component: OData URI Parser
Introduction
OData URI Parser component is used to parse URI which follows the OData format into smaller components and then compose the DataSourceApiQuery object.
Features
"CwODataUriParser Build DataSourceApiQuery From OData Query String" server rule to parse
This component provides a server rule named "CwODataUriParser Build DataSourceApiQuery From OData Query String". The rule receives a few parameters and outputs a corresponding DataSourceApiQuery
object. Here is the list of required parameters:
- DataSourceName [
string
]: The name of the data source that the rule builds the query for - QueryString [
IDictionary<string, IEnumerable<string>>
]: Parameters from the query URI - WhitelistSelectFields [
IEnumerable<string>
]: A list of fields that can be selected. If it contains a "*" element, the rule allows selecting all fields
The QueryString parameter can contain:
- $select: List of field to get. Example: Name,Type
- $filter: Filter string to query. Example:
Name eq 'John' and Type eq 'type1'
. Do not use double quote for values - $orderby: String that represents single or multiple order-by statements. If the clause has "desc" keyword, the data is sorted by the defined field in descending order. Example: Name,Type desc. With this example, the data is sorted by Name in ascending order and then by Type in descending order
- $top: The maximum number of records that can be retrieved. Default value is 100
- $skip: The number of records to skip. Default value is 0
Currently, the component only supports a small set of operators in the filter parameter:
Operator | Description | Example |
---|---|---|
eq | Equal | City eq 'Redmond' |
ne | Not equal | City ne 'London' |
gt | Greater than | Price gt 20 |
ge | Greater than or equal | Price ge 10 |
lt | Less than | Price lt 20 |
le | Less than or equal | Price le 100 |
and | Logical and | Price le 200 and Price gt 3.5 |
or | Logical or | Price le 100 or Price gt 150 |
Installation
Requirements
- Casewhere 2.6.0 or later.
Setup
Import product: Casewhere OData URI Parser
Dependencies
- Plugin: Query Filter String Parser
Releases
1.0.0 - 14/07/2022
Changelog
- "CwODataUriParser Build DataSourceApiQuery From OData Query String" server rule
- Test workflows
Download (login required): OData URI Parser v1.0.0