Filtering

List operations accept a filters query parameter object whose shape depends on the resource (see the OpenAPI reference for each route).

Because list and object inputs are structured objects but HTTP query strings are flat, Corma’s Public API v1 accepts bracket notation encoded objects/arrays in the query-string following those rules:

Usage

  • Use a key with empty brackets ([]) to send a quick array
    filters[tag][]=a&filters[tag][]=b
    
    {
      "tag": ["a", "b"]
    }
    
  • Use string key in brackets ([key]) for object properties
    name[first]=Ada&name[last]=Lovelace
    
    {
      "name": { "first": "Ada", "last": "Lovelace" }
    }
    
  • Use numeric indices in brackets ([0]) to access specific array items
    users[0][status]=authorized&users[0][role]=employee
    
    {
      "users": [
        { "status": "authorized", "role": "employee" }
      ]
    }
    

Edge cases

  • Empty arrays (no item) cannot be represented
  • Empty objects (no key) cannot be reprensented