Readit News logoReadit News
yellow_lead · 3 years ago
I would prefer reading the OpenAPI spec for an API - which is in a standardized format and has easily searchable/skip-able sections, like schemas, endpoints, etc. An interactive tutorial that you mostly read from beginning to end is not convenient for devs - we want to find things within a few seconds of hitting the docs page.
williamdclt · 3 years ago
The point of the article is not to _replace_ the spec. The point of the "four-document types" model is that different document types fit different use-cases.
gdsdfe · 3 years ago
Yeah that looks great for a blog post .. . Good luck writing and maintaining that for a real project in the real world
sigwinch28 · 3 years ago
> According to the popular classification, there are four document types: tutorials, how-to guides, technical references, and explanations.

This is Diátaxis: https://diataxis.fr/

jicea · 3 years ago
The "HTTP" format proposed in the article is the same we use with Hurl [1], an Open Source HTTP CLI based on plain text.

  POST http://httpbingo.org/anything/chat
  content-type: application/json
  
  {
      "message": "Hello!"
  }
We extend it a bit to add checks on response, and add request chaining, but it's basically HTTP 1.x as this article shows it. A lot of others tools have the same idea, with minor differences:

- Hurl (I'm one of the maintainer) https://hurl.dev

- HTTP Client https://www.jetbrains.com/help/idea/http-client-in-product-c...

- httpYac https://httpyac.github.io

- restclient.el https://github.com/pashky/restclient.el

- REST Client https://github.com/Huachao/vscode-restclient

- verb https://github.com/federicotdn/verb

And many more...

Worth noting, other tools have taken the YAML route (like Step CI https://stepci.com), JavaScript (k6 https://k6.io/docs/using-k6/http-requests/)... I'm biased of course, I've a tiny preference for the simple plain text format.

And of course, there are also GUI application (Postman, Insomnia, RecipeUI amon others)

[1]: https://hurl.dev

lux · 3 years ago
One thing that trips me up when I see this 4 quadrant structure for documentation is when to go with a tutorial and when to go with a how-to. Curious how others delineate between those.
kaycebasques · 3 years ago
Tutorial takes you from an exact point A to an exact point B. Guide is much "looser" and just describes the general steps to get something done, without making any type of guarantee of being able to take you exactly from A to B. Mostly out of acknowledgment that the real-world is messy and everyone is going to have a slightly different system. Tutorial is for people starting from scratch or who want a gentle hands-on intro to your thing, guide is for people who are doing messy integration work with existing systems. It's not a perfect delineator but it'll get you most of the way there...
juancampa · 3 years ago
The way I think about it is:

  - Tutorial: learn how the system works
  - How-to: recipes for common use-cases

layer8 · 3 years ago
Tutorial is a Getting Started, with no specific goal other than to serve as a general hands-on introduction. It does not assume any prior experience with the tool/product.

How-to(s) is a cookbook, targeting specific use cases, and may not particularly cater to novices.

ketozhang · 3 years ago
In diataxis, a tutorial serves your education and a how-to guide serves your work.

Following this standard, a tutorial may contain a simpler or more contrived example; it may contain things you'd never do in production.

pattycakes · 3 years ago
OpenAPI is more than just documentation generation, it’s also used for runtime time validation and codegen for both client and server stubs. I’d argue that what’s discussed in this article can complement OpenAPI but doesn’t replace it.
tevon · 3 years ago
I was hopeful starting this article. Because I do think we need something better than OpenAPI for self-documenting APIs...

The idea of an interactive tutorial is great, but as others have mentioned, likely very difficult to maintain over time.

hitchstory · 3 years ago
I built this because I had the same idea: https://github.com/hitchdev/hitchstory

If your specification is self rewriting, can be tested and can be used to generate docs then maintenance costs plummet.

troupo · 3 years ago
What this misses is the curl response format.

Long time ago at Klarna we used this tool: https://github.com/for-GET/katt Here's an example: https://github.com/for-GET/katt/blob/master/doc/example-http...

eyelidlessness · 3 years ago
OpenAPI has great affordances for providing examples along with pertinent documentation sections. Many OpenAPI UIs provide ways to execute those examples or other interactive ways to populate and try requests. These could surely be better honed for the how-to guide style of documentation! But I think that’s probably a better place to start for people who are starting at, and looking to go beyond, what OpenAPI currently provides.