Contributo alla documentazione dell'API Discourse

:bookmark: This is a guide for contributing to the official Discourse API documentation.

:person_raising_hand: Required user level: Developer

:gear: Console access required

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.

Summary

This documentation will guide you through the following steps:

  • Setting up prerequisites.
  • Cloning the Discourse API documentation repository.
  • Editing the API documentation files.
  • Viewing your changes locally.
  • Creating a pull request.

Prerequisites

You must have a Discourse development installation. If you don’t have one, follow the guide that suits your environment in these topics.

Cloning the Discourse API docs repository

Assuming your Discourse development installation is inside your home directory ~/, proceed with the following steps to clone the repository:

  1. From your home directory, clone the repository at https://github.com/discourse/discourse_api_docs:

    git clone https://github.com/discourse/discourse_api_docs
    
  2. You should now have the discourse and discourse_api_docs folders side by side:

    ~/discourse/
    ~/discourse_api_docs/
    

Editing the API documentation files

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

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

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

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

Viewing your changes locally

To view your updated documentation, follow these steps:

  1. From ~/discourse_api_docs/, run:

    npm install
    node server.js
    
  2. Browse to http://localhost:3001 to see the updated documentation.

Creating a pull request

Once you verify that everything looks good, create a pull request from the discourse/discourse repository (not the Discourse API Docs repository).

Common issues and solutions

Reporting errors in Discourse API documentation

If you encounter issues or errors in the Discourse API documentation, please report them on the Discourse Meta forum - you can follow the bug report guide to help you do this effectively.

Additional resources

Last edited by @hugh 2024-06-11T05:08:16Z

Check documentPerform check on document:
15 Mi Piace

Come segnalare errori nella documentazione dell’API di discourse

Il repository Github per la documentazione dell’API non ha la scheda issues attivata

Ciao e benvenuto @srinivas.chilukuri :slight_smile:
Puoi segnalarli qui. :+1: Qual è il problema?

2 Mi Piace

Riferimento: Documentazione API Discourse Ottieni un gruppo

Azioni: Gruppi/ Ottieni un gruppo

  • Nel parametro del percorso della documentazione è mostrato come id, quando interrogato il percorso non esiste
  • Quando la stessa query è stata retroingegnerizzata tramite l’interfaccia utente di Discourse, il parametro del percorso è il nome del gruppo e lo stesso funziona tramite API Key

2 Mi Piace

3 post sono stati divisi in un nuovo argomento: Document basic-info api endpoint