TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why is there no standard for API documentation?

9 pointsby quambenealmost 4 years ago
I&#x27;m currently integrating purchase api for google and apple in my app. And it&#x27;s quite painful because api documentation is often slightly inaccurate, which is leading to a ton of extra debugging.<p>Take this apple purchase api documentation for example: https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;appstorereceipts&#x2F;responsebody.<p>Attribute &quot;is-retryable&quot; is documented as boolean, but in fact it is an integer (0 or 1), which is only explained in the description text.<p>Also, you almost never get the information if an attribute is nullable (or optional). Why not just document nullable like e.g.<p>1.) Type (nullable), or 2.) Option&lt;Type&gt; like in Rust<p>I guess, a strict api documentation standard would help tremendously to save quite some debugging time.

8 comments

gregjoralmost 4 years ago
Because there’s no penalty or cost, and little to no competitive advantage. Only programmers ever see API documentation, and they are not in a position to force better documentation. If good API documentation provides a competitive advantage companies will pay attention to it. Until then they will continue to concentrate on dark mode and emojis.
评论 #27475336 未加载
rocketpastsixalmost 4 years ago
OpenAPI is making some headway in this area, although its hard to get everyone to standardize around _something_. Especially after people have gone through so many different documentation types such as RAML, Apiary, and others.
moasdaalmost 4 years ago
I face the same problem quite often.<p>I think that&#x27;s the reason why some business APIs provide a client library to use the API. Then it&#x27;s easier to add some checks to avoid misuse of the API.
nivertechalmost 4 years ago
That&#x27;s why I like GraphQL, where you have a typed schema (including nullability) and get the documentation for free.
capunoalmost 4 years ago
What about SQL? Not even that has a solid standard; Oracle, Postgres, MySQL... Nothing is compatible! How can we make a standard for something every company has different when we can&#x27;t even make a standard for databases used by everyone.
streetcat1almost 4 years ago
One is json schema. The other very good one is stripe API docs.
评论 #27466330 未加载
throwaway888abcalmost 4 years ago
<a href="https:&#x2F;&#x2F;swagger.io&#x2F;specification&#x2F;" rel="nofollow">https:&#x2F;&#x2F;swagger.io&#x2F;specification&#x2F;</a>
评论 #27466250 未加载
Aperockyalmost 4 years ago
<a href="https:&#x2F;&#x2F;xkcd.com&#x2F;927&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;927&#x2F;</a>
评论 #27473470 未加载