Alex Hedley

Beginners Guide to API Specs

Created by Alex Hedley

Part 1

Part 2

Read It 😜

Petstore JSON

The OpenAPI Specification

OpenAPI Initiative

The OpenAPI Specification

OpenAPI

Lego

Lego Logo

© The LEGO Group.

Lego analogy

Lego Bricks

An instruction manual or step-by-step guide on how to make the model.

It explains the expected behaviour.

Pre-Reqs

HTTP Verbs

  • GET
  • POST
  • PUT
  • DELETE
  • ...

aka CRUD (Create, Read, Update, Delete)

HTTP request methods

Swagger Logo

Petstore

Petstore Swagger page
Petstore Swagger JSON Petstore Swagger JSON (formatted)

Now you can Read It 😀

Petstore JSON

Part 2

Part 1

API Testing

Now you have an API Spec, let's test it out.

Postman Logo

Postman

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.

Postman

Postman

Swagger Editor

Swagger Editor

https://editor.swagger.io

OpenAPI Tools Logo

OpenAPI Generator

Generate clients, servers, and documentation from OpenAPI 2.0/3.x documents

https://openapi-generator.tech https://github.com/OpenAPITools/openapi-generator

Lego API Example

Lego API

API Config

API Config

OpenApiConfig.kt

API Controller

API Controller

BrickController.kt

Chrome Extension

Links

Thanks