Skip to content

openTdataCH/api-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opentransportdata.swiss API-Explorer

This repo allows to browse the OpenAPI specs for opentransportdata.swiss. It publishes a simple site (via GitHub Pages) where each API is rendered with Swagger UI so you can read endpoints, schemas, and pre-authorized try requests directly from the browser.

URL: https://opentdatach.github.io/api-explorer/

Local Preview

$ npm install

# generates dist/ from the templates + config
$ npm run build     

# runs at http://localhost:8080
$ npm run serve     

Adds a new API

# .env (commited, in the repo)
API_KEY_NEWAPI=PLACEHOLDER

# .env.local (file excluded from Git)
API_KEY_NEWAPI=eyJvcmciOiI2NDA....
      - name: Build index.html landing page / API folders
        env:
          # from repo secrets https://github.com/openTdataCH/api-explorer/settings/secrets/actions
          ... more keys
          
          API_KEY_NEWAPI: ${{ secrets.API_KEY_NEWAPI }}        
        run: |
          node scripts/render-openapi.mjs
apis:
  - id: new_service
    title: New Service
    map_secrets:
      API_KEY: API_KEY_NEWAPI
...
  • duplicate any of the folders in openapi/ folder as openapi/new_service.

  • edit the OpenAPI specs in openapi/new_service/openapi.template.yaml file

  • run npm build and inspect the dist folder

Deployment

A GitHub Actions workflow (under .github/workflows/publish-swagger.yml) builds the site and publishes it to GitHub Pages on push to the default branch

License

The project is released under a MIT license.

Copyright (c) 2025 Open Data Platform Mobility Switzerland - opentransportdata.swiss.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors