PoliTO API Spec

The OpenAPI specification for the REST API of Politecnico di Torino.

How to obtain a human-readable interface

If you are accustomed to using Postman, you can just import the .yaml file containing the specification.

Alternatively, you can start a Docker container of swagger-ui directly on your computer by running:

docker-compose up

By default, the web interface will start on port 8080.

About OpenAPI

These definitions provide a single point of truth that can be used end-to-end:

  • Planning Shared during product discussions for planning API functionality
  • Implementation Inform engineering during development
  • Testing As the basis for testing or mocking API endpoints
  • Documentation For producing thorough and interactive documentation
  • Tooling To generate server stubs and client SDKs.

Running a mock API

We suggest using Prism to run a mock version of this API.

After installing it, you can start a mock server with the following command:

prism mock -h YOUR-LOCAL-IP ./openapi.yaml

You only need to specify your IP if you want them to be accessible from other devices in the same network (e.g. while working on @polito/students-app, since it will typically run on a distinct device).

Resources