API Experience is Developer Experience

A presentation at WTFisSRE in May 2023 in London, UK by Lorna Jane Mitchell

Slide 1

Slide 1

API Experience is Developer Experience Lorna Mitchell, Redocly @redocly ~ @lornajane

Slide 2

Slide 2

Postman State of the API report Top concern: how well an API integrates with internal apps and systems. https://www.postman.com/state-of-api/ @redocly ~ @lornajane

Slide 3

Slide 3

API project pre-requisites •API styles and governance •Versioning and deprecation policy •Change review process •Tools to support the lifecycle @redocly ~ @lornajane

Slide 4

Slide 4

Slide 5

Slide 5

Start with standards @redocly ~ @lornajane

Slide 6

Slide 6

OpenAPI descriptions A standard way to describe an API •JSON/YAML format •Endpoints and verbs •Parameters and schemas •Reuse elements with $ref •Responses, including error responses https://openapis.org @redocly ~ @lornajane

Slide 7

Slide 7

OpenAPI example openapi: 3.0.1 servers: - url: http://datasette.local - url: https://datasette.io info: description: Execute SQL queries against a Datasette database and return the results as JSON title: Datasette API version: v1 paths: /content.json: get: description: Accepts SQLite SQL query, returns JSON. Does not allow PRAGMA statements. Credit: https://github.com/APIs-guru/openapi-directory @redocly ~ @lornajane

Slide 8

Slide 8

API style guides Covering style, compliance and other requirements Existing guidelines, can you pick one? •https://apistylebook.com/design/guidelines/ Create your own: •https://nordicapis.com/11-tips @redocly ~ @lornajane

Slide 9

Slide 9

Process and culture @redocly ~ @lornajane

Slide 10

Slide 10

Proposing API changes •Useful and timely feedback mechanisms •Consider user needs, and existing conventions •Think (very hard) about how things are named Design-first APIs @redocly ~ @lornajane

Slide 11

Slide 11

Automate for success Get tooling into CI/CD setup: •Use linting to check API fits standards •Create documentation previews •Spin up mock servers Encourage stakeholders to try the changed API @redocly ~ @lornajane

Slide 12

Slide 12

API experience at scale @redocly ~ @lornajane

Slide 13

Slide 13

API catalog Central registry/marketplace/inventory •All APIs are registered here •OpenAPI descriptions •Establish documentation conventions •Team contact information •Standards/readiness @redocly ~ @lornajane

Slide 14

Slide 14

API catalog @redocly ~ @lornajane

Slide 15

Slide 15

API lifecycle tools tl;dr https://openapi.tools/ @redocly ~ @lornajane

Slide 16

Slide 16

OpenAPI linters •Programmatically check API description •Validate •Style checks •Ensure awesomeness @redocly ~ @lornajane

Slide 17

Slide 17

API documentation Docs are more than API reference! •Overview •Quickstart •Tutorials •Concepts @redocly ~ @lornajane

Slide 18

Slide 18

API documentation @redocly ~ @lornajane

Slide 19

Slide 19

Transform OpenAPI When your OpenAPI input isn’t complete enough for all it’s outputs, enhance it. Emerging tools: •OpenAPI overlays specification •Redocly decorators feature @redocly ~ @lornajane

Slide 20

Slide 20

Slide 21

Slide 21

API Lifecycle DevX @redocly ~ @lornajane

Slide 22

Slide 22

Resources •https://lornajane.net •https://redocly.com •https://openapi.tools •https://www.postman.com/state-of-api/ •https://apistylebook.com •https://github.com/APIs-guru/openapi-directory @redocly ~ @lornajane