Contribute to the Discourse API Docs ๐Ÿ“œ

Do you want to contribute to the official API documentation at https://docs.discourse.org/?
This guide will explain step by step how to do it. :slight_smile:

Prerequisites

You must have a Discourse development installation.

If you donโ€™t have one, follow the guide that suits your environment: Docs - Discourse Meta

Clone Discourse API docs repo

Weโ€™ll assume your Discourse development install is inside your home directory ~/.

From your home directory, clone https://github.com/discourse/discourse_api_docs :

git clone https://github.com/discourse/discourse_api_docs

You should now have discourse and discourse_api_docs folders side by side:

~/discourse/
~/discourse_api_docs/

Edit the API documentation files

You must edit the documentation directly from ~/discourse/spec/requests/api/.[1]

After editing the documentation files, run the following command from ~/discourse/:

bin/rake rswag:specs:swaggerize && cp openapi/openapi.yaml ~/discourse_api_docs/openapi.yml

The documentation will be generated using rswag and copied into ~/discourse_api_docs.

View your changes locally

To view your updated documentation, run these commands from ~/discourse_api_docs/

npm install
node server.js

Browse to http://localhost:3001 to see the pretty docs.
If everything looks good, create a pull request from the discourse/discourse repository (not the Discourse API Docs repository ).


  1. See the folder on Github: https://github.com/discourse/discourse/tree/main/spec/requests/api โ†ฉ๏ธŽ

15 Likes

How to report errors in discourse api documentation

Github repo for api documentation does not issues tab activated

Hello and welcome @srinivas.chilukuri :slight_smile:

You can report them on here. :+1: What seems to be the isssue?

2 Likes

Reference : Discourse API Documentation Get a Group

Actions: Groups/ Get a Group

  • In documentation path parameter is shown as id ,when queried the path doesnโ€™t exist
  • When reverse engineered same query via discourse UI the path parameter is group name and same works via API Key

2 Likes

3 posts were split to a new topic: Document basic-info api endpoint