design-first api development using swagger and node

30
1 Design-First API Development Using Swagger & Node Scott Ganyo, Apigee Prabhat Jha, Apigee @theganyo @prabhatjha

Upload: apigee-google-cloud

Post on 13-Apr-2017

1.015 views

Category:

Software


3 download

TRANSCRIPT

Page 1: Design-first API Development using Swagger and Node

1

Design-First API Development Using Swagger & Node

Scott Ganyo, Apigee Prabhat Jha, Apigee @theganyo @prabhatjha

Page 2: Design-first API Development using Swagger and Node

Agenda

2

1. APIs - What and Why

2. What is Design-First API development?

3. Some Apigee internal use cases4. Customer Reference5. Tools & demo6. Q&A

©2015 Apigee. All Rights Reserved.

Page 3: Design-first API Development using Swagger and Node

APIS

3

Page 4: Design-first API Development using Swagger and Node

An API…

Defines an HTTP service

Serves its client apps

Drives service adoption

APIs

4©2015 Apigee. All Rights Reserved.

Page 5: Design-first API Development using Swagger and Node

APIs are for…

Developers

Apps :

• External

• Internal

Microservices

Devices

5©2015 Apigee. All Rights Reserved.

Page 6: Design-first API Development using Swagger and Node

What APIs are not ?

SOA++

ESB

6©2015 Apigee. All Rights Reserved.

Page 7: Design-first API Development using Swagger and Node

Design-First API Development

7

Page 8: Design-first API Development using Swagger and Node

The Zen of API Development

The code defines the API

The API generates the code

The code is the API

API-driven code

8©2015 Apigee. All Rights Reserved.

Page 9: Design-first API Development using Swagger and Node

The code defines the API

9©2015 Apigee. All Rights Reserved.

Annotation-driven

Maintained in code

API is generated

Page 10: Design-first API Development using Swagger and Node

The API generates the codeInterface Definition Language (IDL) defines the API

Client and server side code stubs are generated

Examples: SOAP, CORBA, and similar RPC systems

10©2015 Apigee. All Rights Reserved.

Page 11: Design-first API Development using Swagger and Node

The code is the API

11©2015 Apigee. All Rights Reserved.

Interpreted

No formal specification

Page 12: Design-first API Development using Swagger and Node

API-driven philosophy

12©2015 Apigee. All Rights Reserved.

The API must be designed first.

Page 13: Design-first API Development using Swagger and Node

API-driven philosophy

13©2015 Apigee. All Rights Reserved.

API design, documentation, and code must remain in sync.

Page 14: Design-first API Development using Swagger and Node

API-driven philosophy

14©2015 Apigee. All Rights Reserved.

The system must adhere to the "DRY Principle."

Page 15: Design-first API Development using Swagger and Node

API-driven philosophy

15©2015 Apigee. All Rights Reserved.

The API must directly drive runtime and documentation.

Page 16: Design-first API Development using Swagger and Node

Swagger-Node

16

Page 17: Design-first API Development using Swagger and Node

Swagger-Node: Flow Diagram

17©2015 Apigee. All Rights Reserved.

Page 18: Design-first API Development using Swagger and Node

Swagger-Node

18©2015 Apigee. All Rights Reserved.

The API is written in Swagger, optionally using API Studio (apistudio.io)

The Swagger API document is parsed when server starts

Incoming calls are classified, validated, and routed in real time

Integrates with Connect, Express, Hapi, Restify, Sails...

Incorporates a plugin model for Swagger (or non-Swagger) extensions

Page 19: Design-first API Development using Swagger and Node

Apigee Use Cases

19

Page 20: Design-first API Development using Swagger and Node

Use case: Recommendation API (Apigee Insights)

• To personalize an app experience, developers need to quickly create APIs that mashup results from big fata machine learning and real-time events. Swagger-node enables quick creation of those APIs via Swagger, and create the business-logic necessary in node.js.

20©2015 Apigee. All Rights Reserved.

Page 21: Design-first API Development using Swagger and Node

Use case: API Studio

• Authoring• Collaboration• Response simulation

21©2015 Apigee. All Rights Reserved.

Page 22: Design-first API Development using Swagger and Node

Use case: Test Coverage

• Historical test coverage analysis• APIs for CI to update• UI for test teams

22©2015 Apigee. All Rights Reserved.

Page 23: Design-first API Development using Swagger and Node

Customer Reference

23

Page 24: Design-first API Development using Swagger and Node

Burberry

24©2015 Apigee. All Rights Reserved.

Page 25: Design-first API Development using Swagger and Node

Tools & Demo

25

Page 26: Design-first API Development using Swagger and Node

API Lifecycle management tools• Write & Collaborate:

– API Studio (http://apistudio.io)• Develop :

– Swagger-Node (npm install -g swagger)• Deploy

• Apigee Edge• Your PaaS

• Publish• Apigee Dev Portal• API Studio

26©2015 Apigee. All Rights Reserved.

Page 27: Design-first API Development using Swagger and Node

Demo

27©2015 Apigee. All Rights Reserved.

Page 28: Design-first API Development using Swagger and Node

Where to get help?

https://community.apigee.com

28©2015 Apigee. All Rights Reserved.

Page 29: Design-first API Development using Swagger and Node

Q&A

29

Page 30: Design-first API Development using Swagger and Node

Thank You

30