1 of 16

Interoperable REST APIs

with OpenAPI3 and connexion

EuroPython 2019

Basel, 9th July 2019

ROBERTO POLLI TEAM PER LA TRASFORMAZIONE DIGITALE

2 of 16

The Italian Digital Team

API Interoperability 101

& Training setup

OpenAPI Modeling

Implementing APIs with Connexion

Using YAML features to improve interoperability

Authorization & Throttling

Pagination & Validation

Agenda

3 of 16

Make public services

for citizens and businesses accessible in an easy manner,

via a mobile first approach,

with reliable, scalable and fault tolerant architectures,

based on clearly defined APIs.

Team

Mission

4 of 16

Roberto Polli - I love writing in Python, C and Java

RHC{E,VA}, MySQL|MongoDB Certified DBA

API Ecosystem @ TeamDigitale

Who am I

5 of 16

Course Setup

6 of 16

Training materials

  • Course registration http://bit.ly/2NILw9T

  • Course agenda

  • Course repository

  • Interoperable API Presentation

7 of 16

API 101

8 of 16

REST in the New Italian Interoperability Framework

  • Enable the creation of new services for citizens, lowering setup and maintenance/operation costs

  • Simplify communication with non-governmental agencies

  • Acknowledge that public services are usually about data and resources

  • Keep current with the IT world ;)

  • REST without Richardson Maturity Model constraints

9 of 16

The Quest: an Italian API Ecosystem

  • Standardize HTTP APIs for 20k agencies and 60M people

  • API-first approach to REST APIs

  • Scheme standardization based on national, European and industry standards

  • Availability strategy based on a distributed circuit-breaker and throttling patterns

  • National API Catalogue

10 of 16

OpenAPI v3

11 of 16

Describing APIs

API-First:

  • publish interfaces
  • involve stakeholders in API lifecycle

Communicate:

  • technical specifications
  • metadata
  • docs & references

12 of 16

OpenAPI 3.0 aka OAS3

Initiative under the Linux Foundation, participated by gov & co (gov.uk, Microsoft, Google, Oracle, IBM, ..)

Driver for API adoption

WSDL for REST APIs

Evolution of Swagger 2.0

13 of 16

OpenAPI aka OAS3

Lightweight format: YAML

Generates docs & code via tools (swagger-editor, apicur.io)

Reusable components via hyperlink (eg. $ref)

A set of curated objects available on github: interoperability by reuse!

14 of 16

References

15 of 16

New (ongoing) Italian Framework

16 of 16

Roberto Polli

roberto@teamdigitale.governo.it

@ioggstream

@teamdigitaleIT

@team-per-la-trasformazione-digitale

teamdigitale.governo.it