-
Notifications
You must be signed in to change notification settings - Fork 62
Re-think HTTP API Documentation #69
Comments
Pulling in @olizilla’s comment from #68:
|
Oh, that’s neat! I wonder if there is anything similar that can do diffs for OpenAPI (it feels a little more standard, which I like, and has a decent ecosystem of tools around it, but is certainly not perfect).
Yeah, to be clear, I wasn’t thinking a manually written doc needed be written in HTML and not one of these :) Good point about a structured format making it programmatically verifiable.
I don’t know if it needs or even should be though of as a specification (depends a lot on how you interpret that word), but seeing and comparing both implementations in one place is one of the major advantages I was thinking of here. |
That said, I think it’s really critical that whatever format we use makes it easy to include copious explanatory text and multiple examples. These are the things people have problems with in the current version. It’s explanations don’t say much and its examples aren’t really examples. (My previous experiences with OpenAPI was that having a lot of that felt kinda cramped inside the YAML structure and the standard templates don’t always provide good markup parsing for the content.) |
Just adding bits of context here for things that we have explored and problems that we have identified:
|
Closing, since this issue has been consolidated into the overall effort for improving/automating API/CLI documentation in #393. Comments have been migrated there! |
One of the things I called out in the current docs PR (#68) and in the research is the issues around the HTTP API docs (https://ipfs.io/ipfs/QmVUdHfpo9hyC8wXmgd2frRrsp83iRvuL8HWyp1LPzjsPq/reference/api/http/). Virtually every user I’ve talked with finds them to be pretty bad (sometimes entirely unhelpful) and has cheered when shown the
interface-ipfs-core
“specs,” even though they don’t cover HTTP-specific concerns! Specifically:They are way too thin. All the in-depth docs in the Go code (where the HTTP docs are generated) can’t be used because they are very specific to the CLI and would be confusing for HTTP.
They are specific to the Go implementation (they miss anything that might be unique to
js-ipfs
; they include without noting the situation things that are unique togo-ipfs
)They don’t cover changes over time.
I do think it’s helpful that there is a single HTTP API reference and that it’s not buried inside the Go-specific docs because the recommended model for programmatic usage is to treat it like PostgreSQL or Redis, where it should run as a separate process locally. So I don’t think the right solution is to generate implementation- and version-specific docs and put them alongside the
js-ipfs
andgo-ipfs
docs.I see two possible solutions here:
Maintain HTTP API docs separately, by hand, rather than generating them from
go-ipfs
.Add a
LongHttpDescription
field tocmdkit.HelpText
in Go and some similar way of generating HTTP API docs fromjs-ipfs
. Generate implementation- and version-specific HTTP API docs for each and put them in the “JS Implementation” and “Go Implementation” sections of the docs site. Keep a top-level one that is just a copy of the current release version of the Go HTTP docs, but make sure it includes links to the HTTP docs for all the other versions/implementations.I propose doing # 1. It is less technologically savvy, but makes it easier to separate HTTP-specific concerns and to play with various ways of documenting things. Does anybody have strong opinions about either (or a different, better idea)?
/cc @daviddias @alanshaw @whyrusleeping @Stebalien
The text was updated successfully, but these errors were encountered: