Skip to content

feat: use HelpText.HTTP for Content-Type documentation#2248

Merged
lidel merged 4 commits intomainfrom
feat/helptext-http-field
Feb 26, 2026
Merged

feat: use HelpText.HTTP for Content-Type documentation#2248
lidel merged 4 commits intomainfrom
feat/helptext-http-field

Conversation

@lidel
Copy link
Member

@lidel lidel commented Jan 30, 2026

updates http-api-docs to read Content-Type from the new HelpText.HTTP.ResponseContentType field to document returned content-type at https://docs.ipfs.tech/reference/kubo/rpc/ when the next Kubo release (0.40) ships.

changes:

  • extract contentType and httpDescription from Helptext.HTTP
  • add HTTPDescription field to Endpoint struct for future use
  • show Content-Type without backticks for better readability
  • improve response text for endpoints with/without Content-Type

depends on:

updates http-api-docs to read Content-Type from the new
HelpText.HTTP.ResponseContentType field instead of cmd.Extra.

changes:
- extract contentType and httpDescription from Helptext.HTTP
- add HTTPDescription field to Endpoint struct for future use
- show Content-Type without backticks for better readability
- improve response text for endpoints with/without Content-Type

depends on:
- go-ipfs-cmds@0ab930fef0cd (feat: add HTTPHelpText)
- kubo@70b7f0736d5b (feat: use HelpText.HTTP for Content-Type)
@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

🚀 Build Preview on IPFS ready

- tools/http-api-docs: kubo v0.39.1-pre → v0.40.0, go 1.25 → 1.26
- .github/actions/update-with-latest-versions: golang:1.25 → golang:1.26
- swarm/peers example showed {"Strings": [...]} format from years ago,
  replaced with accurate {"Peers": [{...}]} matching v0.40.0 output
- flags example used removed object/get endpoint, replaced with block/stat
- added note that cli --enc=json produces the same json as http rpc api
- fix fmt.Fprintln vet error (redundant newline) in markdown.go
- go fix: interface{} -> any in endpoints.go

files:
- tools/http-api-docs/markdown.go: intro template fixes
- tools/http-api-docs/endpoints.go: go fix modernization
- docs/reference/kubo/generate-cli-docs.sh: same intro fix
- docs/reference/kubo/rpc.md: regenerated
- docs/reference/kubo/cli.md: regenerated

This resolves all symlinks, including CLI arguments and those found inside
directories. Symlinks to files become regular file content, symlinks to
directories are traversed and their contents are added.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short). (COMMA_COMPOUND_SENTENCE_2[4])
Suggestions: , and
URL: https://languagetool.org/insights/post/types-of-sentences/#compound-sentence
Rule: https://community.languagetool.org/rule/show/COMMA_COMPOUND_SENTENCE_2?lang=en-US&subId=4
Category: PUNCTUATION

'ipfs files write' creates a trickle-dag optimized for append-only operations.
See '--trickle' in 'ipfs add --help' for more information.

NOTE: The 'Import.UnixFSFileMaxLinks' config option does not apply to this command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION


Mode and mtime are optional UnixFS metadata. They are only present if the
content was imported with 'ipfs add --preserve-mode' and '--preserve-mtime'.
Without preserved metadata, both mode and mtime display '-'. Times are in UTC.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION


Mode and mtime are optional UnixFS metadata. They are only present if the
content was imported with 'ipfs add --preserve-mode' and '--preserve-mtime'.
Without preserved metadata, both mode and mtime display '-'. Times are in UTC.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION


Example:

> ipfs swarm addrs autonat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
Suggestions: autonat
Rule: https://community.languagetool.org/rule/show/ENGLISH_WORD_REPEAT_RULE?lang=en-US
Category: MISC

@lidel lidel marked this pull request as ready for review February 26, 2026 01:32
@lidel lidel merged commit 114e0c0 into main Feb 26, 2026
5 of 6 checks passed
@lidel lidel deleted the feat/helptext-http-field branch February 26, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant