Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.
/ SL.se-api-specs Public archive

DEPRECATED: Stockholms Lokaltrafik API Swagger Specs

License

Notifications You must be signed in to change notification settings

stranne/SL.se-api-specs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SL.se OpenAPI Specification

Build Status

Swagger specification for SL.se API found at Trafiklab.

This repository contains documentations with Swagger specifications. It's a standardizised way of defining an API with either JSON or YAML which include operations and models. With this you can for example generate code to produce or consume, ie server or client.

Include documentations for the following APIs:

Generate client

With Swagger Code Generator clients and servers can be generated by using this specification, https://stranne.github.io/SL.se-api-specs/swagger.json, for multiple languages.

Some of the supported client generators, for more examples check here.

  • android
  • csharp
  • java
  • php
  • python
  • ruby
  • swift3
  • typescript-angular2

Generate online

To generate a client online, go here. On that page, expand and navigate to clients -> POST /gen/clients/{language}. Select one of the languages in the dropdown and paste the JSON below into the body textarea.

{
  "spec": {},
  "options": {},
  "swaggerUrl": "https://stranne.github.io/SL.se-api-specs/swagger.json"
}

Click Try it out! and you will get a url in the response. You can download it once to acquire a zip-folder of the generated client.

Links

Warning: All above links are updated only after Travis CI finishes deployment

Working on specification

Install

  1. Install Node JS
  2. Clone repo and cd
    • Run npm install

Usage

  1. Run npm start
  2. Checkout console output to see where local server is started. You can use all links (except preview) by replacing https://stranne.github.io/SL.se-api-specs/ with url from the message: Server started <url>
  3. Make changes using your favorite editor or swagger-editor (look for URL in console output)
  4. All changes are immediately propagated to your local server, moreover all documentation pages will be automagically refreshed in a browser after each change TIP: you can open swagger-editor, documentation and swagger-ui in parallel
  5. Once you finish with the changes you can run tests using: npm test
  6. Share you changes with the rest of the world by pushing to GitHub 😄

Releases

No releases published

Packages

No packages published