SlideShare uma empresa Scribd logo
Hackolade Tutorial
Part 12 - Create a REST API model
Copyright © 2016-2023 Hackolade 1
In this Tutorial
• How to visually design a schema-centric REST API, using the Swagger
or OpenAPI specification
• No need to know the Swagger/OpenAPI syntax
• but need to know the features...
• Fits really well with API-first and design-first processes
• Especially when combined with NoSQL data stores: access patterns and APIs
are very often aligned – and therefore so is their model
• Helps to understand existing APIs: visual representation of
Swagger/OpenAPI files
• Hackolade Studio will reverse engineer these files into a data model
• Focusing on OpenAPI – principles also apply to Swagger
Copyright © 2016-2023 Hackolade 2
Example: URL shortener
• a user creates an entry based on a full URL, and receives a
short slug generated by the service
• any system can send a slug and get back the full URL.
• The example is inspired by Shorty, an existing service
Copyright © 2016-2023 Hackolade 3
Output: visual model for the API
Copyright © 2016-2023 Hackolade
Output: generated corresponding API file
Copyright © 2016-2023 Hackolade 5
Design the API
• Put yourself in the shoes of the consumer & make it easy to
understand and navigate
• Start with a sequence diagram:
Copyright © 2016-2023 Hackolade 6
First process: create entry based on full URL,
Receive short slug generated by service
Second process: Send a slug, get back the full URL
Sequence is important!
• Many Swagger tutorials start with info, then paths, then components
• We recommend that you start with the foundation: schema describing the
structure of the service contract between producer and consumer
• Process:
1. create reusable components
• schema for the exchange
• request body to submit a long URL, using the schema
• parameter to fetch the full URL from a slug
• responses
• returning the generated slug (200 - OK) using the schema
• returning an error message, reusable for different kinds of errors
• an OAuth2 security scheme (can be done later)
2. create resources with requests and responses
3. add endpoint, tags, and metadata information, plus color coding of responses
4. generate the OpenAPI documentation file, with API testing
Copyright © 2016-2023 Hackolade 7
Create reusable components
1. Schema for the exchange
• URL: for happy flow exchange
• LongURL
• Slug
• Error: for error messages
• StatusCode
• Message
Copyright © 2016-2023 Hackolade 8
Create reusable components
2. Request body to submit a long URL
Copyright © 2016-2023 Hackolade 9
Create reusable components
3. Parameter to fetch a full URL from a previously generated slug
Copyright © 2016-2023 Hackolade 10
Create reusable components
4. A couple of responses
Copyright © 2016-2023 Hackolade 11
Create a response structure Template gets created
Start with 200 - OK The structure now references the component schema:
Create reusable components
5. A security schema
Copyright © 2016-2023 Hackolade 12
Create resources with requests and responses
• Assemble the reusable components in resource paths
Copyright © 2016-2023 Hackolade 13
Create resources with requests and responses
• Add a request
Copyright © 2016-2023 Hackolade 14
POST: submit a full URL and/or a custom slug
Create resources with requests and responses
• Assign a tag
• Work in the dedicated tab
Copyright © 2016-2023 Hackolade 15
Create resources with requests and responses
• different ways to build a request, all represented in the template.
Copyright © 2016-2023 Hackolade 16
Create resources with requests and responses
• Add a response
Copyright © 2016-2023 Hackolade 17
Create resources with requests and responses
• Work in the dedicated tab
Copyright © 2016-2023 Hackolade 18
Create resources with requests and responses
• 400: did not confirm to schema
• 403: forbidden request that did not provide credentials
Copyright © 2016-2023 Hackolade 19
Resulting API
Copyright © 2016-2023 Hackolade 20
Second use case
Copyright © 2016-2023 Hackolade 21
Finishing touches
• Metadata: server endpoints, tag descriptions, links to documentation
Copyright © 2016-2023 Hackolade 22
Generate the OpenAPI documentation file
Copyright © 2016-2023 Hackolade 23
API creation debate
• Code-first vs. design-first?
• Design-first helps you think through all the details, discuss
alternatives with stakeholders, evaluate impacts, etc.
• Advantages = Lower TCO, higher quality, easier evolution, and…
quicker Time to Value!
• Reduces the risk of rework!
• See this article by Smartbear, creators of Swagger
Copyright © 2016-2023 Hackolade 24
Reading material
• See Hackolade online documentation
• The Hackolade Blog
• This excellent new book:
MongoDB Data Modeling & Schema Design
• Many of the principles in the book are related to query
driven modeling based on access patterns!
• Hackolade’s on social media: LinkedIn page, Twitter page
• Download Hackolade studio for free
Copyright © 2016-2023 Hackolade 25
Questions?
Answers!
Copyright © 2016-2023 Hackolade 26

Mais conteúdo relacionado

Semelhante a Hackolade Tutorial - part 12 - Create a REST API model

IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
Karen Broughton-Mabbitt
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
University of Hawai‘i at Mānoa
 
Mvc 4.0
Mvc 4.0Mvc 4.0
James Higginbotham - API Design
James Higginbotham - API DesignJames Higginbotham - API Design
James Higginbotham - API Design
John Zozzaro
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
BIOVIA
 
Logic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIsLogic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIs
Sriram Hariharan
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
apidays
 
Tutorial Workgroup - Model versioning and collaboration
Tutorial Workgroup - Model versioning and collaborationTutorial Workgroup - Model versioning and collaboration
Tutorial Workgroup - Model versioning and collaboration
PascalDesmarets1
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
Scribe online 03 scribe online cdk and api overview
Scribe online 03   scribe online cdk and api overviewScribe online 03   scribe online cdk and api overview
Scribe online 03 scribe online cdk and api overview
Scribe Software Corp.
 
CC Technology Summit 3 Update
CC Technology Summit 3 UpdateCC Technology Summit 3 Update
CC Technology Summit 3 Update
Nathan Yergler
 
Brushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersBrushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developers
ONE BCG
 
Apidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, Cisco
Apidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, CiscoApidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, Cisco
Apidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, Cisco
apidays
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
Lori Head
 
Api design best practice
Api design best practiceApi design best practice
Api design best practice
Red Hat
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
SmartBear
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
Fabio Tiriticco
 
RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)
Cisco DevNet
 
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
Mahek Merchant
 

Semelhante a Hackolade Tutorial - part 12 - Create a REST API model (20)

IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
Mvc 4.0
Mvc 4.0Mvc 4.0
Mvc 4.0
 
James Higginbotham - API Design
James Higginbotham - API DesignJames Higginbotham - API Design
James Higginbotham - API Design
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
Logic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIsLogic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIs
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
 
Tutorial Workgroup - Model versioning and collaboration
Tutorial Workgroup - Model versioning and collaborationTutorial Workgroup - Model versioning and collaboration
Tutorial Workgroup - Model versioning and collaboration
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Scribe online 03 scribe online cdk and api overview
Scribe online 03   scribe online cdk and api overviewScribe online 03   scribe online cdk and api overview
Scribe online 03 scribe online cdk and api overview
 
CC Technology Summit 3 Update
CC Technology Summit 3 UpdateCC Technology Summit 3 Update
CC Technology Summit 3 Update
 
Brushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersBrushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developers
 
Apidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, Cisco
Apidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, CiscoApidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, Cisco
Apidays Paris 2023 - Managing OpenAPI Documents at Scale, Stéve Sfartz, Cisco
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
 
Api design best practice
Api design best practiceApi design best practice
Api design best practice
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)
 
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 

Mais de PascalDesmarets1

Tutorial Workgroup - Working with Forks
Tutorial Workgroup - Working with ForksTutorial Workgroup - Working with Forks
Tutorial Workgroup - Working with Forks
PascalDesmarets1
 
Tutorial Advanced How-To - Oracle 23c Duality views
Tutorial Advanced How-To - Oracle 23c Duality viewsTutorial Advanced How-To - Oracle 23c Duality views
Tutorial Advanced How-To - Oracle 23c Duality views
PascalDesmarets1
 
Tutorial Expert How-To - Docker-based automation
Tutorial Expert How-To - Docker-based automationTutorial Expert How-To - Docker-based automation
Tutorial Expert How-To - Docker-based automation
PascalDesmarets1
 
Tutorial Getting Started part 4 - Domain-Driven Data Modeling
Tutorial Getting Started part 4 - Domain-Driven Data ModelingTutorial Getting Started part 4 - Domain-Driven Data Modeling
Tutorial Getting Started part 4 - Domain-Driven Data Modeling
PascalDesmarets1
 
Tutorial Getting Started part 3 - Metadata-as-Code
Tutorial Getting Started part 3 - Metadata-as-CodeTutorial Getting Started part 3 - Metadata-as-Code
Tutorial Getting Started part 3 - Metadata-as-Code
PascalDesmarets1
 
Tutorial Getting Started part 2 - Polyglot Data Modeling
Tutorial Getting Started part 2 - Polyglot Data ModelingTutorial Getting Started part 2 - Polyglot Data Modeling
Tutorial Getting Started part 2 - Polyglot Data Modeling
PascalDesmarets1
 
Tutorial Expert How-To - Create a model for Avro schemas
Tutorial Expert How-To - Create a model for Avro schemasTutorial Expert How-To - Create a model for Avro schemas
Tutorial Expert How-To - Create a model for Avro schemas
PascalDesmarets1
 
Tutorial Getting Started part 1 - Overview
Tutorial Getting Started part 1 - OverviewTutorial Getting Started part 1 - Overview
Tutorial Getting Started part 1 - Overview
PascalDesmarets1
 
Tutorial Expert How-To - Verify Data Model
Tutorial Expert How-To - Verify Data ModelTutorial Expert How-To - Verify Data Model
Tutorial Expert How-To - Verify Data Model
PascalDesmarets1
 
Tutorial Expert How-To - Naming Conventions
Tutorial Expert How-To - Naming ConventionsTutorial Expert How-To - Naming Conventions
Tutorial Expert How-To - Naming Conventions
PascalDesmarets1
 
Tutorial Expert How-To - Export-Import with Excel template
Tutorial Expert How-To - Export-Import with Excel templateTutorial Expert How-To - Export-Import with Excel template
Tutorial Expert How-To - Export-Import with Excel template
PascalDesmarets1
 
Tutorial Expert How-To - Compare and Merge
Tutorial Expert How-To - Compare and MergeTutorial Expert How-To - Compare and Merge
Tutorial Expert How-To - Compare and Merge
PascalDesmarets1
 
Tutorial Expert How-To - Custom properties
Tutorial Expert How-To - Custom propertiesTutorial Expert How-To - Custom properties
Tutorial Expert How-To - Custom properties
PascalDesmarets1
 
Tutorial Expert How-To - Add reusable Definitions
Tutorial Expert How-To - Add reusable DefinitionsTutorial Expert How-To - Add reusable Definitions
Tutorial Expert How-To - Add reusable Definitions
PascalDesmarets1
 
Hackolade Tutorial - part 13 - Leverage a Polyglot data model
Hackolade Tutorial - part 13 - Leverage a Polyglot data modelHackolade Tutorial - part 13 - Leverage a Polyglot data model
Hackolade Tutorial - part 13 - Leverage a Polyglot data model
PascalDesmarets1
 
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdf
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdfHackolade Tutorial - part 8 - Import or reverse-engineer.pdf
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdf
PascalDesmarets1
 
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdfHackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
PascalDesmarets1
 
Hackolade Tutorial - part 4 - Create your first data model
Hackolade Tutorial - part 4 - Create your first data modelHackolade Tutorial - part 4 - Create your first data model
Hackolade Tutorial - part 4 - Create your first data model
PascalDesmarets1
 
Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...
Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...
Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...
PascalDesmarets1
 
Hackolade Tutorial - part 2 - Overview of JSON and JSON schema
Hackolade Tutorial - part 2 - Overview of JSON and JSON schemaHackolade Tutorial - part 2 - Overview of JSON and JSON schema
Hackolade Tutorial - part 2 - Overview of JSON and JSON schema
PascalDesmarets1
 

Mais de PascalDesmarets1 (20)

Tutorial Workgroup - Working with Forks
Tutorial Workgroup - Working with ForksTutorial Workgroup - Working with Forks
Tutorial Workgroup - Working with Forks
 
Tutorial Advanced How-To - Oracle 23c Duality views
Tutorial Advanced How-To - Oracle 23c Duality viewsTutorial Advanced How-To - Oracle 23c Duality views
Tutorial Advanced How-To - Oracle 23c Duality views
 
Tutorial Expert How-To - Docker-based automation
Tutorial Expert How-To - Docker-based automationTutorial Expert How-To - Docker-based automation
Tutorial Expert How-To - Docker-based automation
 
Tutorial Getting Started part 4 - Domain-Driven Data Modeling
Tutorial Getting Started part 4 - Domain-Driven Data ModelingTutorial Getting Started part 4 - Domain-Driven Data Modeling
Tutorial Getting Started part 4 - Domain-Driven Data Modeling
 
Tutorial Getting Started part 3 - Metadata-as-Code
Tutorial Getting Started part 3 - Metadata-as-CodeTutorial Getting Started part 3 - Metadata-as-Code
Tutorial Getting Started part 3 - Metadata-as-Code
 
Tutorial Getting Started part 2 - Polyglot Data Modeling
Tutorial Getting Started part 2 - Polyglot Data ModelingTutorial Getting Started part 2 - Polyglot Data Modeling
Tutorial Getting Started part 2 - Polyglot Data Modeling
 
Tutorial Expert How-To - Create a model for Avro schemas
Tutorial Expert How-To - Create a model for Avro schemasTutorial Expert How-To - Create a model for Avro schemas
Tutorial Expert How-To - Create a model for Avro schemas
 
Tutorial Getting Started part 1 - Overview
Tutorial Getting Started part 1 - OverviewTutorial Getting Started part 1 - Overview
Tutorial Getting Started part 1 - Overview
 
Tutorial Expert How-To - Verify Data Model
Tutorial Expert How-To - Verify Data ModelTutorial Expert How-To - Verify Data Model
Tutorial Expert How-To - Verify Data Model
 
Tutorial Expert How-To - Naming Conventions
Tutorial Expert How-To - Naming ConventionsTutorial Expert How-To - Naming Conventions
Tutorial Expert How-To - Naming Conventions
 
Tutorial Expert How-To - Export-Import with Excel template
Tutorial Expert How-To - Export-Import with Excel templateTutorial Expert How-To - Export-Import with Excel template
Tutorial Expert How-To - Export-Import with Excel template
 
Tutorial Expert How-To - Compare and Merge
Tutorial Expert How-To - Compare and MergeTutorial Expert How-To - Compare and Merge
Tutorial Expert How-To - Compare and Merge
 
Tutorial Expert How-To - Custom properties
Tutorial Expert How-To - Custom propertiesTutorial Expert How-To - Custom properties
Tutorial Expert How-To - Custom properties
 
Tutorial Expert How-To - Add reusable Definitions
Tutorial Expert How-To - Add reusable DefinitionsTutorial Expert How-To - Add reusable Definitions
Tutorial Expert How-To - Add reusable Definitions
 
Hackolade Tutorial - part 13 - Leverage a Polyglot data model
Hackolade Tutorial - part 13 - Leverage a Polyglot data modelHackolade Tutorial - part 13 - Leverage a Polyglot data model
Hackolade Tutorial - part 13 - Leverage a Polyglot data model
 
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdf
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdfHackolade Tutorial - part 8 - Import or reverse-engineer.pdf
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdf
 
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdfHackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
 
Hackolade Tutorial - part 4 - Create your first data model
Hackolade Tutorial - part 4 - Create your first data modelHackolade Tutorial - part 4 - Create your first data model
Hackolade Tutorial - part 4 - Create your first data model
 
Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...
Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...
Hackolade Tutorial - part 3 - Query-driven data modeling based on access patt...
 
Hackolade Tutorial - part 2 - Overview of JSON and JSON schema
Hackolade Tutorial - part 2 - Overview of JSON and JSON schemaHackolade Tutorial - part 2 - Overview of JSON and JSON schema
Hackolade Tutorial - part 2 - Overview of JSON and JSON schema
 

Último

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 

Último (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 

Hackolade Tutorial - part 12 - Create a REST API model

  • 1. Hackolade Tutorial Part 12 - Create a REST API model Copyright © 2016-2023 Hackolade 1
  • 2. In this Tutorial • How to visually design a schema-centric REST API, using the Swagger or OpenAPI specification • No need to know the Swagger/OpenAPI syntax • but need to know the features... • Fits really well with API-first and design-first processes • Especially when combined with NoSQL data stores: access patterns and APIs are very often aligned – and therefore so is their model • Helps to understand existing APIs: visual representation of Swagger/OpenAPI files • Hackolade Studio will reverse engineer these files into a data model • Focusing on OpenAPI – principles also apply to Swagger Copyright © 2016-2023 Hackolade 2
  • 3. Example: URL shortener • a user creates an entry based on a full URL, and receives a short slug generated by the service • any system can send a slug and get back the full URL. • The example is inspired by Shorty, an existing service Copyright © 2016-2023 Hackolade 3
  • 4. Output: visual model for the API Copyright © 2016-2023 Hackolade
  • 5. Output: generated corresponding API file Copyright © 2016-2023 Hackolade 5
  • 6. Design the API • Put yourself in the shoes of the consumer & make it easy to understand and navigate • Start with a sequence diagram: Copyright © 2016-2023 Hackolade 6 First process: create entry based on full URL, Receive short slug generated by service Second process: Send a slug, get back the full URL
  • 7. Sequence is important! • Many Swagger tutorials start with info, then paths, then components • We recommend that you start with the foundation: schema describing the structure of the service contract between producer and consumer • Process: 1. create reusable components • schema for the exchange • request body to submit a long URL, using the schema • parameter to fetch the full URL from a slug • responses • returning the generated slug (200 - OK) using the schema • returning an error message, reusable for different kinds of errors • an OAuth2 security scheme (can be done later) 2. create resources with requests and responses 3. add endpoint, tags, and metadata information, plus color coding of responses 4. generate the OpenAPI documentation file, with API testing Copyright © 2016-2023 Hackolade 7
  • 8. Create reusable components 1. Schema for the exchange • URL: for happy flow exchange • LongURL • Slug • Error: for error messages • StatusCode • Message Copyright © 2016-2023 Hackolade 8
  • 9. Create reusable components 2. Request body to submit a long URL Copyright © 2016-2023 Hackolade 9
  • 10. Create reusable components 3. Parameter to fetch a full URL from a previously generated slug Copyright © 2016-2023 Hackolade 10
  • 11. Create reusable components 4. A couple of responses Copyright © 2016-2023 Hackolade 11 Create a response structure Template gets created Start with 200 - OK The structure now references the component schema:
  • 12. Create reusable components 5. A security schema Copyright © 2016-2023 Hackolade 12
  • 13. Create resources with requests and responses • Assemble the reusable components in resource paths Copyright © 2016-2023 Hackolade 13
  • 14. Create resources with requests and responses • Add a request Copyright © 2016-2023 Hackolade 14 POST: submit a full URL and/or a custom slug
  • 15. Create resources with requests and responses • Assign a tag • Work in the dedicated tab Copyright © 2016-2023 Hackolade 15
  • 16. Create resources with requests and responses • different ways to build a request, all represented in the template. Copyright © 2016-2023 Hackolade 16
  • 17. Create resources with requests and responses • Add a response Copyright © 2016-2023 Hackolade 17
  • 18. Create resources with requests and responses • Work in the dedicated tab Copyright © 2016-2023 Hackolade 18
  • 19. Create resources with requests and responses • 400: did not confirm to schema • 403: forbidden request that did not provide credentials Copyright © 2016-2023 Hackolade 19
  • 20. Resulting API Copyright © 2016-2023 Hackolade 20
  • 21. Second use case Copyright © 2016-2023 Hackolade 21
  • 22. Finishing touches • Metadata: server endpoints, tag descriptions, links to documentation Copyright © 2016-2023 Hackolade 22
  • 23. Generate the OpenAPI documentation file Copyright © 2016-2023 Hackolade 23
  • 24. API creation debate • Code-first vs. design-first? • Design-first helps you think through all the details, discuss alternatives with stakeholders, evaluate impacts, etc. • Advantages = Lower TCO, higher quality, easier evolution, and… quicker Time to Value! • Reduces the risk of rework! • See this article by Smartbear, creators of Swagger Copyright © 2016-2023 Hackolade 24
  • 25. Reading material • See Hackolade online documentation • The Hackolade Blog • This excellent new book: MongoDB Data Modeling & Schema Design • Many of the principles in the book are related to query driven modeling based on access patterns! • Hackolade’s on social media: LinkedIn page, Twitter page • Download Hackolade studio for free Copyright © 2016-2023 Hackolade 25