GithubHelp home page GithubHelp logo

stranne / sl.se-api-specs Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.11 MB

DEPRECATED: Stockholms Lokaltrafik API Swagger Specs

Home Page: https://stranne.github.io/SL.se-api-specs/

License: MIT License

JavaScript 80.83% HTML 19.17%
stockholms-lokaltrafik swagger-specification

sl.se-api-specs's Introduction

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 😄

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.