2026-05-04 14:59:48 +01:00

1.7 KiB

Documentation

These files are generated using the swaggo/swag tool.

There are two steps, first generating the docs and then running the web server.

  1. Build the docs
    docker compose build
    
  2. Serve the docs
    docker compose up
    
  3. Go to http://127.0.0.1:8080/swagger/index.html to view the docs

Locally

Install go.

Generating the docs

  1. Set the current working dir to src
    cd src
    
  2. Run swag to generate the docs
    • Option 1, via go
      go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault --outputTypes "go,json"
      
    • Option 2, directly with swag
      swag init --requiredByDefault --outputTypes "go,json"
      
    • Option 3, swag via docker
      docker run --rm -v $(pwd):/code ghcr.io/swaggo/swag:latest init --requiredByDefault --outputTypes "go,json"
      
  3. Set the current working dir to src/docs
    cd docs
    
  4. Run the script to add the receive V1 schemas from https://github.com/AsamK/signal-cli#json-schemas-for-the-json-rpc-mode
    go run add_v1_receive_schemas.go ./path-to-signal-cli-json-schema-folder
    

Run the web server

Run the web server to visualize the generated docs.

  1. Navigate to the src folder
    cd src
    
  2. Run the main script
    go run main.go
    
  3. Go to http://127.0.0.1:8080/swagger/index.html