You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like the DSL Amber Feng form Stripe outlined in this blog post. Would love to see this project add support for something like that, ie. required, document, etc.
eg.
classChargeCreateMethod < AbstractAPIMethodrequired:amount,:integerrequired:card_number,:stringdocument:amount,"Amount, in cents."document:card_number,"The card number."resourceChargeAPIResourcedefexecutecreate_charge(amount,card_number)endendclassChargeAPIResource < AbstractAPIResourcerequired:id,:stringrequired:amount,:integerrequired:card_number,:stringrequired:success,:booleandefdescribe_card_numbercharge.redacted_card_numberendend
A good UX design principle is that you should make it really hard for your users to mess up or do the wrong thing. Why not apply this toward building the API as well?
One thing that we did that I thought was really cool was a system for documenting our API. To try to address "I forgot to update the docs!" syndrome, we made it really hard to forget by putting the documentation right under the code that adds a new property.
Our documentation then auto-generates itself from these specs—for changing most things, there's no need to go dig up static HTML files.
I really like the DSL Amber Feng form Stripe outlined in this blog post. Would love to see this project add support for something like that, ie.
required
,document
, etc.eg.
Source: Amber Feng - Move Fast, Don't Break Your API
The text was updated successfully, but these errors were encountered: