Hacker News new | ask | show | jobs
by snewman 4608 days ago
I wish this sort of thing were more common. For debugging purposes if nothing else, it's helpful to support custom metadata everywhere in an API -- every data type, every logged operation.
1 comments

I agree.

And also, because a lot of the power of APIs comes from the unexpected ways in which people use them I think API providers should encourage unexpected use-cases.

We've just finished doing a similar thing to Stripe, having built an "attributes" key:value store against pretty much anything in our API: http://microcosm-cc.github.io/#attributes

One of the goals we have from that, even without knowing the use-cases behind it, is to have the attributes be first class entities.

Such that you can find things by their attributes, or set up permissions with things like "people with this attribute can do that".

APIs can be really constricting or they can be liberating. Obviously the provider of an API needs to support whatever the API does, and usually this means that the API goals must match the goals of the provider. But in things like metadata/attributes/extended data... there is a real potential to offer a powerful capability that can be supported by the provider and yet allows the API developer to define the use-case themselves.