dead simple apis with openapi - linuxrecruit.co.uk of dead simple apis with... · @dragonmantank...

33
@dragonmantank Dead Simple APIs with OpenAPI

Upload: others

Post on 11-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Dead Simple APIs with OpenAPI

Page 2: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

What is OpenAPI?

Page 3: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

● Define endpoints that are available

● What verbs can be used

● What responses look like

● Authentication Methods

http://spec.openapis.org/oas/v3.0.3

Page 4: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

(It's a specification)

● Define endpoints that are available

● What verbs can be used

● What responses look like

● Authentication Methods

http://spec.openapis.org/oas/v3.0.3

Page 5: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

(It's a specification)

● Define endpoints that are available

● What verbs can be used

● What responses look like

● Authentication Methods

http://spec.openapis.org/oas/v3.0.3

Page 6: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

(It's a specification)

● Define endpoints that are available

● What verbs can be used

● What responses look like

● Authentication Methods

http://spec.openapis.org/oas/v3.0.3

Page 7: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

(It's a specification)

● Define endpoints that are available

● What verbs can be used

● What responses look like

● Authentication Methods

http://spec.openapis.org/oas/v3.0.3

Page 8: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

(It's a specification)

● Define endpoints that are available

● What verbs can be used

● What responses look like

● Authentication Methods

http://spec.openapis.org/oas/v3.0.3

Page 9: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Why OpenAPI?

Page 10: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Description as Code

Page 11: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 12: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Tooling Integrations

https://openapi.tools/

Page 13: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Documentation Generation

Page 14: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank https://github.com/Nexmo/nexmo-oas-renderer

Page 15: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Designing APIs

Page 16: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

openapi: 3.0.0info: version: 1.2.5 title: Voice APIservers:- url: https://api.nexmo.com/v1/callspaths: "/": get: security: - bearerAuth: [] description: Get details parameters: - name: status in: query schema: type: string responses: '200': description: Ok

https://swagger.io/docs/specification/basic-structure/

Page 17: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank https://stoplight.io/studio/

Page 18: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 19: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 20: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 21: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 22: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 23: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Prototyping and Mocking APIs

Page 24: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 25: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 26: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 27: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank https://www.postman.com/

Page 28: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank https://www.postman.com/collection

Page 29: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Generating API Code

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

Page 30: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

● ASP.Net● C++● Golang● Java● PHP● NodeJS Express● Ruby on Rails

Page 31: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

$ openapi-generator-cli \ generate \ -i demo.yaml \ -g javascript \ -o $(pwd)/js

Page 32: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Page 33: Dead Simple APIs with OpenAPI - linuxrecruit.co.uk of Dead Simple APIs with... · @dragonmantank (It's a specification) Define endpoints that are available What verbs can be used

@dragonmantank

Chris Tankersley

Developer Advocate at Nexmo/Vonage

@[email protected]