GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - discourse/discourse_api_docs: Discourse API Documentation

BranchesTags
Open more actions menu

Latest commit

 

History

546 Commits
546 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
definitions
definitions
 
 
postman
postman
 
 
responses
responses
 
 
.gitignore
.gitignore
 
 
CNAME
CNAME
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
bruno-collection.json
bruno-collection.json
 
 
categories.yml
categories.yml
 
 
favicon.png
favicon.png
 
 
index-versioned.html
index-versioned.html
 
 
index.html
index.html
 
 
lefthook.yml
lefthook.yml
 
 
local.html
local.html
 
 
logo.svg
logo.svg
 
 
openapi.json
openapi.json
 
 
openapi.yml
openapi.yml
 
 
openapi_changed.sh
openapi_changed.sh
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
server.js
server.js
 
 
to_json.rb
to_json.rb
 
 
tobruno.js
tobruno.js
 
 
tojson.js
tojson.js
 
 
toschema.js
toschema.js
 
 

Repository files navigation

Discourse API Documentation

automatic updates

To view the the Discourse API Documentation you can visit:

https://docs.discourse.org/

Contributing

Contributions are welcome! Start by cloning this repo as well as the discourse repo.

The API docs are automatically generated from the discourse repo using a tool called rswag.

You can generate the openapi.yml file that is located in this repo by running this command from inside of your discourse repo directory:

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

Please do not manually edit the openapi.yml or openapi.json files located in this repo. These files must be edited from the rswag files located in

https://github.com/discourse/discourse/tree/main/spec/requests/api

To view your changes locally, run:

npm install
node server.js

Browse to http://localhost:3001 to see the pretty docs.

Before you push your changes or create a PR convert the yml file to json:

node tojson.js

To verify converting to json worked correctly, please run:

node server.js json

which will load the json file directly instead of live converting the yml file to json. Now browse to http://localhost:3001 and verify your changes still look okay.

Then you can commit your changes and create a PR. This is because we are using github pages to host the static doc website.

Automatic openapi.yml generation

If you are changing multiple API specs in the core Discourse repo, then you can use the bundle exec rake autospec:swagger rake task to watch for changes to files in the spec/requests/api directory. When a change is detected the swaggerize rake task command is run, the openapi.yml file is generated, and node tojson.js is run.

This can all be done while the local API docs server is running for live updates every time API spec files are changed.

Schema Generator

To aid in writing the yml responses in the swagger.yml file use this command to convert actual json responses to a yml schema file:

node toschema.js <input file> <output file>

Example:

node toschema.js responses/topics/topic_respones.json definitions/topics/topic_response.yml

This will convert a json response into json schema and then convert the schema to yml.

About

Discourse API Documentation

docs.discourse.org/

Resources

Readme
MIT license
Activity
Custom properties

Stars

45 stars

Watchers

18 watching

Forks

35 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.