Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a field with the object type #14

Closed
matin opened this issue Aug 17, 2012 · 3 comments
Closed

Add a field with the object type #14

matin opened this issue Aug 17, 2012 · 3 comments

Comments

@matin
Copy link
Member

matin commented Aug 17, 2012

This is the core problem from #13.

The transactions endpoint returns holds, debits, refunds, and debits. You can't filter out specific objects because there is no field to filter on. If balanced added something akin to "object": "debit" it would solve this problem.

@bcm
Copy link

bcm commented Oct 9, 2012

Any movement on this? We're still hoping to filter holds out of our transaction history.

@mahmoudimus
Copy link
Contributor

There are a few reasons why this is particularly useful:

  1. For static clients, it allows the mapping to objects in java/.NET pretty trivial as it's just a registry lookup instead of a matching/type mapping on the URI scheme. Since those languages have very limited dynamic abilities, this makes it much easier to program for those languages. See http://john-sheehan.com/post/18688963163/dont-build-the-best-rest-api-build-the-best-http-api
  2. Right now, our clients use the information in the URIs to map them to objects, this trivializes the casts to objects and avoids brittleness in our clients.
  3. It allows discoveries and polymorphism via objects in a pretty standard manner.
  4. However, I'm proposing another addition for type casting, which is _uris or _uri_types. For example, if we had an invoices endpoint that gave a convenient "failed_debits" link that pre-constructed the query parameter, it would be impossible to figure out the type that would come back from that URI. This will allow us to construct the right object from URIs.

@steveklabnik
Copy link
Contributor

This has since been taken care of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants