SlideShare a Scribd company logo
1 of 43
Download to read offline
THE SECRET INGREDIENT
BEHIND RESTful APIs
SPECIFICATIONS
How to better document, make relevant examples and better
test APIs ?
Paris, 30th of january 2018
2//
Who has already met
a crash on frontend
due to a response not
matching the
API specification?
3//
Who has already
heard about
JSON schema
concept?
4//
01 //
The problems we faced
5//
Design UX/UI
IS legacy opening and
integraton Architecture
Devops Front end web
Big Data, Smart
Data, Fast Data
Back end web
AI
(chat bots, machine learning…)
SaaS - PaaS / Cloud IOT
Mobile Apps
(development, product
management) API management
Front end web
6//
Customers, Project Managers, Developers
There is a crash
on my app!!!
Customer detects a problem on her app...
7//
Customers, Project Managers, Developers
Project Manager tries to find where the problem comes from...
There is a crash
on my app!!!
We’re looking for the
source of the problem
8//
Customers, Project Managers, Developers
Regarding logs, Project Manager has identified it’s related to a specific API call
There is a crash
on my app!!!
We’re looking for the
source of the problem
Where does it come from?
Let’s have a look at the logs
Oh it seems to be related to
this specific API call
9//
Customers, Project Managers, Developers
Project Manager asks the developer why we have met this problem and how to fix it...
Could you fix it quickly
please? It’s critical...
Could you tell me why the app crash
when it does such API call please?
10//
Customers, Project Managers, Developers
Developer gives the diagnosis...
Could you tell me why the app crash
when it does such API call please?
Oh I see
why it’s
crashing...
Could you fix it quickly
please? It’s critical...
11//
Customers, Project Managers, Developers
Developer gives the diagnosis...API specification does not match the current response that causes the frontend crash!
Could you tell me why the app crash
when it does such API call please?
Oh I see
why it’s
crashing...
..it’s because API specification I used for my dev
does not match this response...
Could you fix it quickly
please? It’s critical...
12//
Customers, Project Managers, Developers
We wonder where is the truth… we all faced the same problems
WHICH SPECIFICATIONS
ARE WE TALKING ABOUT?
WHICH SPECIFICATIONS
ARE WE TALKING ABOUT?
WHICH SPECIFICATIONS
ARE WE TALKING ABOUT?
13//
Yesterday: different tools to test, document and mock APIs
Test tool spec
(e.g. POSTMan)
14//
Yesterday: different tools to test, document and mock APIs
Documentation tool spec
(e.g. Word, Swagger)
Test tool spec
(e.g. POSTMan)
15//
Yesterday: different tools to test, document and mock APIs
Documentation tool spec
(e.g. Word, Swagger)
Mocking tool spec
(e.g. WireMock)
Test tool spec
(e.g. POSTMan)
16//
Finding a way
to have a single
source of truth!
The goal?
17//
Three options
One tool to rule them all
(POSTMan, Restlet have more &
more features)
Synchronize different tools,
highly dependent on what
they allow to import or export
Build a new tool
01
02
03
18//
02 //
How to specify a JSON?
19//
JSON Schema
{
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"description": "Age in years",
"type": "integer",
"minimum": 0
}
},
"required": ["firstName", "lastName"]
}
Example
20//
JSON Schema
What does it allow you to do?
Test
Documentation
Mock
21//
03 //
How to expand JSON schema
concept to RESTful API level?
22//
Resource
Example - A user
User
23//
Attributes of a resource
Example - A user
id
firstname
lastname
age
User
{
"user": {
"id": 1200,
"firstname": "Arthur",
"lastname": "Martin",
"age": 17
}
}
JSON Instance
24//
Get user information
GET /users/:id
Routes
Example - user resource
Create a user
POST /users
Update a user
PUT /users/:id
Delete a user
DELETE /users/:id
25//
Pericles: API Description
A whole API project
YOUR PROJECT
RESOURCES
ATTRIBUTES ROUTES
REQUESTS RESPONSES
26//
Representation of your resource
Example - create a user
firstname
lastname
User
27//
Representation of your resource
Example - create a user
POST /users - Body of request
{
"title": "User",
"type": "object",
"properties": {
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"required": ["firstName", "lastName"]
}
}
firstname
lastname
User
28//
Representation of your resource
Example - get user information
GET /users/:id - Body of response
{
"title": "User",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"age": {
"description": "Age in years",
"type": "integer",
"minimum": 0
},
"required": [“id”,"firstName", "lastName"]
}
}
id
firstname
lastname
age
User
29//
Pericles: API Description
A whole API project through representations
YOUR PROJECT
RESOURCES
ATTRIBUTES ROUTES
REQUESTS RESPONSES
Resource representations
30//
Pericles: API Description
A whole API project through representations
YOUR PROJECT
RESOURCES
ATTRIBUTES ROUTES
REQUESTS RESPONSES
JSON SCHEMA Collection
Resource representations
31//
03 //
Why is JSON schema still
underused?
32//
A tedious tool
33//
Our hero, hidden in the shadows
Solution
USER SPACE SCHEMA MANAGEMENT
34//
04 //
What to do with your API defined
with schema ?
35//
Customer, Project Managers
Lost of time in trying to replay a use case...
My app is crashing again,
it’s embarrassing...
I’ll take a look at it
OK I’m good for an hour to replay this use case,
but pretty sure my customer API is faulty
36//
Test with a proxy
Client ServerProxy
37//
Project Managers, Developers
Lost of time in updating thousands of files...
So could you please update the specs
with the new API specifications please?
Sure...
I need to modify thousands of files
(mocks, doc, …), what a nightmare!
38//
Mock APIs
MockClient
39//
Document APIs
40//
Customers, Project Managers, Developers
Problems solved - time saving for everyone !
My specs are always
up to date!
When the API is not
aligned with the specs
I will know it easily!
Keeping the specs up to
date is now simple!
41//
05 //
Conclusion
42//
43//
https://github.com/applidium/pericles

More Related Content

Similar to APIDays 2018 - API Development Lifecycle - The secret ingredient behind RESTful APIs Specifications

APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...apidays
 
Dead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPIDead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPIChris Tankersley
 
apidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeonapidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeonapidays
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open StandardsAPIsecure_ Official
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreStormpath
 
Speaking APIsh makes your business more agile
Speaking APIsh makes your business more agileSpeaking APIsh makes your business more agile
Speaking APIsh makes your business more agileMarjukka Niinioja
 
Barcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentBarcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentHoat Le
 
Donald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New TricksDonald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New TricksServerlessConf
 
Open Event API
Open Event APIOpen Event API
Open Event APIAvi Aryan
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsTom Johnson
 
API Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rantAPI Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rantVladimir Shulyak
 
API Documentation presentation to East Bay STC Chapter
API Documentation presentation to East Bay STC ChapterAPI Documentation presentation to East Bay STC Chapter
API Documentation presentation to East Bay STC ChapterTom Johnson
 
API Documentation -- Presentation to East Bay STC Chapter
API Documentation -- Presentation to East Bay STC ChapterAPI Documentation -- Presentation to East Bay STC Chapter
API Documentation -- Presentation to East Bay STC ChapterTom Johnson
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIsNLJUG
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Peter Hendriks
 
Mistakes to-avoid-api-product
Mistakes to-avoid-api-productMistakes to-avoid-api-product
Mistakes to-avoid-api-productRahul Dighe
 

Similar to APIDays 2018 - API Development Lifecycle - The secret ingredient behind RESTful APIs Specifications (20)

APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
 
Dead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPIDead Simple APIs with OpenAPI
Dead Simple APIs with OpenAPI
 
apidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeonapidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeon
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards
 
Walter api
Walter apiWalter api
Walter api
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
 
Speaking APIsh makes your business more agile
Speaking APIsh makes your business more agileSpeaking APIsh makes your business more agile
Speaking APIsh makes your business more agile
 
Barcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentBarcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application Development
 
APIs v2
APIs v2APIs v2
APIs v2
 
Donald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New TricksDonald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New Tricks
 
Open Event API
Open Event APIOpen Event API
Open Event API
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
API Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rantAPI Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rant
 
Apache Persistence Layers
Apache Persistence LayersApache Persistence Layers
Apache Persistence Layers
 
Service virtualization with npm modules updated
Service virtualization with npm modules updatedService virtualization with npm modules updated
Service virtualization with npm modules updated
 
API Documentation presentation to East Bay STC Chapter
API Documentation presentation to East Bay STC ChapterAPI Documentation presentation to East Bay STC Chapter
API Documentation presentation to East Bay STC Chapter
 
API Documentation -- Presentation to East Bay STC Chapter
API Documentation -- Presentation to East Bay STC ChapterAPI Documentation -- Presentation to East Bay STC Chapter
API Documentation -- Presentation to East Bay STC Chapter
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 
Mistakes to-avoid-api-product
Mistakes to-avoid-api-productMistakes to-avoid-api-product
Mistakes to-avoid-api-product
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

APIDays 2018 - API Development Lifecycle - The secret ingredient behind RESTful APIs Specifications

  • 1. THE SECRET INGREDIENT BEHIND RESTful APIs SPECIFICATIONS How to better document, make relevant examples and better test APIs ? Paris, 30th of january 2018
  • 2. 2// Who has already met a crash on frontend due to a response not matching the API specification?
  • 3. 3// Who has already heard about JSON schema concept?
  • 5. 5// Design UX/UI IS legacy opening and integraton Architecture Devops Front end web Big Data, Smart Data, Fast Data Back end web AI (chat bots, machine learning…) SaaS - PaaS / Cloud IOT Mobile Apps (development, product management) API management Front end web
  • 6. 6// Customers, Project Managers, Developers There is a crash on my app!!! Customer detects a problem on her app...
  • 7. 7// Customers, Project Managers, Developers Project Manager tries to find where the problem comes from... There is a crash on my app!!! We’re looking for the source of the problem
  • 8. 8// Customers, Project Managers, Developers Regarding logs, Project Manager has identified it’s related to a specific API call There is a crash on my app!!! We’re looking for the source of the problem Where does it come from? Let’s have a look at the logs Oh it seems to be related to this specific API call
  • 9. 9// Customers, Project Managers, Developers Project Manager asks the developer why we have met this problem and how to fix it... Could you fix it quickly please? It’s critical... Could you tell me why the app crash when it does such API call please?
  • 10. 10// Customers, Project Managers, Developers Developer gives the diagnosis... Could you tell me why the app crash when it does such API call please? Oh I see why it’s crashing... Could you fix it quickly please? It’s critical...
  • 11. 11// Customers, Project Managers, Developers Developer gives the diagnosis...API specification does not match the current response that causes the frontend crash! Could you tell me why the app crash when it does such API call please? Oh I see why it’s crashing... ..it’s because API specification I used for my dev does not match this response... Could you fix it quickly please? It’s critical...
  • 12. 12// Customers, Project Managers, Developers We wonder where is the truth… we all faced the same problems WHICH SPECIFICATIONS ARE WE TALKING ABOUT? WHICH SPECIFICATIONS ARE WE TALKING ABOUT? WHICH SPECIFICATIONS ARE WE TALKING ABOUT?
  • 13. 13// Yesterday: different tools to test, document and mock APIs Test tool spec (e.g. POSTMan)
  • 14. 14// Yesterday: different tools to test, document and mock APIs Documentation tool spec (e.g. Word, Swagger) Test tool spec (e.g. POSTMan)
  • 15. 15// Yesterday: different tools to test, document and mock APIs Documentation tool spec (e.g. Word, Swagger) Mocking tool spec (e.g. WireMock) Test tool spec (e.g. POSTMan)
  • 16. 16// Finding a way to have a single source of truth! The goal?
  • 17. 17// Three options One tool to rule them all (POSTMan, Restlet have more & more features) Synchronize different tools, highly dependent on what they allow to import or export Build a new tool 01 02 03
  • 18. 18// 02 // How to specify a JSON?
  • 19. 19// JSON Schema { "title": "Person", "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "age": { "description": "Age in years", "type": "integer", "minimum": 0 } }, "required": ["firstName", "lastName"] } Example
  • 20. 20// JSON Schema What does it allow you to do? Test Documentation Mock
  • 21. 21// 03 // How to expand JSON schema concept to RESTful API level?
  • 23. 23// Attributes of a resource Example - A user id firstname lastname age User { "user": { "id": 1200, "firstname": "Arthur", "lastname": "Martin", "age": 17 } } JSON Instance
  • 24. 24// Get user information GET /users/:id Routes Example - user resource Create a user POST /users Update a user PUT /users/:id Delete a user DELETE /users/:id
  • 25. 25// Pericles: API Description A whole API project YOUR PROJECT RESOURCES ATTRIBUTES ROUTES REQUESTS RESPONSES
  • 26. 26// Representation of your resource Example - create a user firstname lastname User
  • 27. 27// Representation of your resource Example - create a user POST /users - Body of request { "title": "User", "type": "object", "properties": { "firstname": { "type": "string" }, "lastname": { "type": "string" }, "required": ["firstName", "lastName"] } } firstname lastname User
  • 28. 28// Representation of your resource Example - get user information GET /users/:id - Body of response { "title": "User", "type": "object", "properties": { "id": { "type": "integer" }, "firstname": { "type": "string" }, "lastname": { "type": "string" }, "age": { "description": "Age in years", "type": "integer", "minimum": 0 }, "required": [“id”,"firstName", "lastName"] } } id firstname lastname age User
  • 29. 29// Pericles: API Description A whole API project through representations YOUR PROJECT RESOURCES ATTRIBUTES ROUTES REQUESTS RESPONSES Resource representations
  • 30. 30// Pericles: API Description A whole API project through representations YOUR PROJECT RESOURCES ATTRIBUTES ROUTES REQUESTS RESPONSES JSON SCHEMA Collection Resource representations
  • 31. 31// 03 // Why is JSON schema still underused?
  • 33. 33// Our hero, hidden in the shadows Solution USER SPACE SCHEMA MANAGEMENT
  • 34. 34// 04 // What to do with your API defined with schema ?
  • 35. 35// Customer, Project Managers Lost of time in trying to replay a use case... My app is crashing again, it’s embarrassing... I’ll take a look at it OK I’m good for an hour to replay this use case, but pretty sure my customer API is faulty
  • 36. 36// Test with a proxy Client ServerProxy
  • 37. 37// Project Managers, Developers Lost of time in updating thousands of files... So could you please update the specs with the new API specifications please? Sure... I need to modify thousands of files (mocks, doc, …), what a nightmare!
  • 40. 40// Customers, Project Managers, Developers Problems solved - time saving for everyone ! My specs are always up to date! When the API is not aligned with the specs I will know it easily! Keeping the specs up to date is now simple!
  • 42. 42//