balanced / balanced-api

Balanced API specification.
220 stars 72 forks source link

Allow Filtering of Capitalized meta fields #671

Closed mdsib closed 6 years ago

mdsib commented 9 years ago

Currently there is no way to filter meta fields when they contain capitalization! I don't think there's a problem with disallowing capitalized meta fields, but it is confusing when they are allowed but not filterable.

mjallday commented 9 years ago

confirmed, this does not work as expected.

curl https://api.balancedpayments.com/bank_accounts \
      -H "Accept: application/vnd.api+json;revision=1.1" \
      -u ak-test-DXIgzoqwN4LsoCabloqy87y42qwm1lXR: \
      -d "routing_number=121000358" \
      -d "account_type=checking" \
      -d "name=Johann Bernoulli" \
      -d "account_number=9900000001" \
      -d "meta[Foo]=baz"
{
  "bank_accounts": [
    {
      "routing_number": "121000358",
      "bank_name": "BANK OF AMERICA, N.A.",
      "account_type": "checking",
      "name": "Johann Bernoulli",
      "links": {
        "customer": null,
        "bank_account_verification": null
      },
      "can_credit": true,
      "created_at": "2014-07-30T18:19:04.851763Z",
      "fingerprint": "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
      "updated_at": "2014-07-30T18:19:04.851766Z",
      "href": "/bank_accounts/BA7HGs1UYkvv74aTMqKttfdX",
      "meta": {
        "Foo": "baz"
      },
      "account_number": "xxxxxx0001",
      "address": {
        "city": null,
        "line2": null,
        "line1": null,
        "state": null,
        "postal_code": null,
        "country_code": null
      },
      "can_debit": false,
      "id": "BA7HGs1UYkvv74aTMqKttfdX"
    }
  ],
  "links": {
    "bank_accounts.credits": "/bank_accounts/{bank_accounts.id}/credits",
    "bank_accounts.bank_account_verifications": "/bank_accounts/{bank_accounts.id}/verifications",
    "bank_accounts.customer": "/customers/{bank_accounts.customer}",
    "bank_accounts.debits": "/bank_accounts/{bank_accounts.id}/debits",
    "bank_accounts.bank_account_verification": "/verifications/{bank_accounts.bank_account_verification}"
  }
}

and then

curl "https://api.balancedpayments.com/bank_accounts?meta.Foo=baz" \
      -H "Accept: application/vnd.api+json;revision=1.1" \
      -u ak-test-DXIgzoqwN4LsoCabloqy87y42qwm1lXR:

gives

{
  "bank_accounts": [],
  "meta": {
    "last": "/bank_accounts?meta.Foo=baz&limit=10&offset=0",
    "next": null,
    "href": "/bank_accounts?meta.Foo=baz&limit=10&offset=0",
    "limit": 10,
    "offset": 0,
    "previous": null,
    "total": 0,
    "first": "/bank_accounts?meta.Foo=baz&limit=10&offset=0"
  },
  "links": {}
}
mdsib commented 6 years ago

I think this project is dead because balanced is dead so I'm closing this.