As of June 2023 this repository is no longer actively maintained by the GOV.UK Pay team.
Preview and publish API browser for internal app APIs which include below.
API can be previewed using tech-docs-template (https://tdt-documentation.london.cloudapps.digital/) or swagger-editor (https://editor.swagger.io/)
Requires
- Ruby to preview docs using tech docs template
- Docker to preview API using swagger-editor
- cf CLI to deploy to PaaS
To preview API docs of an app, run the below command (which reads Open API specs from the app Github repo)
./build.sh [app] [browser]
app - values supported: adminusers, connector, ledger, products, publicauth, webhooks
browser - values supported: tech-docs-template, swagger
-
Example 1: (to preview connector docs using tech-docs-template)
./build.sh connector tech-docs-template
View docs at http://localhost:4567
-
Example 2: (to preview connector docs using swagger editor)
./build.sh connector swagger
View docs at http://localhost:8080
To use a specific branch
-
Specify the branch name or commit sha to use using BRANCH variable as below:
Example:
BRANCH=726bcbb4257f1ffe55435ee29ed0a0196d92ceb8 ./build.sh connector swagger
To preview API docs from a local repo
-
Specify the
LOCATION=local
variable. Note that $WORKSPACE is to be set and should point to the repositories parent folder.Example:
LOCATION=local ./build.sh adminusers tech-docs-template
To publish API browser for an app, run below:
./deploy.sh [app_name]
app_name: Allowed values - adminusers, connector, products, publicauth, ledger, webhooks
Docs are published to
PaaS location : api.cloud.service.gov.uk
org : govuk-pay
space : sandbox
Location: Publishes docs to URL govuk-pay-[app_name]-api-browser.cloudapps.digital
-
Example
./deploy.sh connector
Open docs at https://govuk-pay-connector-api-browser.cloudapps.digital
Note below for the deploy:
- Only publishes using tech-docs-template
- Generates tech-docs.yml and manifest.yml required before publishing