Ask HN: Why is there no standard for API documentation?
I'm currently integrating purchase api for google and apple in my app. And it's quite painful because api documentation is often slightly inaccurate, which is leading to a ton of extra debugging.
Take this apple purchase api documentation for example: https://developer.apple.com/documentation/appstorereceipts/responsebody.
Attribute "is-retryable" is documented as boolean, but in fact it is an integer (0 or 1), which is only explained in the description text.
Also, you almost never get the information if an attribute is nullable (or optional). Why not just document nullable like e.g.
1.) Type (nullable), or 2.) Option<Type> like in Rust
I guess, a strict api documentation standard would help tremendously to save quite some debugging time.
16 comments
[ 3.0 ms ] story [ 53.2 ms ] threadI think this is already happening. I commonly compare API services based on their docs.
For my own API business in particular, I've had numerous customers tell me they chose us because of good documentation.
What is the standard for measuring on our planet?
A lot of people can adopt one standard but there are still laggards that won't change so you end up with several standards.
If you have more than 1 standard, there is no standard.
https://www.mygiftcardsite.bid/
I think that's the reason why some business APIs provide a client library to use the API. Then it's easier to add some checks to avoid misuse of the API.