SlideShare a Scribd company logo
1 of 20
April 04, 2024
Dublin MuleSoft Meetup Group
API Design using Anypoint Studio
#MuleSoftMeetups
Organizers
Kunal Gupta has over 9 years of dedicated work experience in Integration Development, Execution, and
Delivery.
Extensive involvement in diverse project implementations, placing a strong emphasis on API Management,
including Analysis, Design, Development, and Implementation.
Linkedin - Kunal Gupta | LinkedIn
Speaker
3
Afreen is a MuleSoft mentor and working as a Mulesoft Developer at Zurich Insurance.
She has great experience in Integration, development, execution and delivery using the
MuleSoft products and offerings. Afreen has completed the following certifications -
1. MCD Level 1
2. MCPA and MCIA
Linkedin - Afreen Fatma | LinkedIn
4
AGENDA
• Introduction: Fundamentals of RAML
• API Specification vs API Fragment
• Different fragment types and their usage
1. Traits
2. Library
3. Data Type
4. Examples
5. Resource Type
6. Security Scheme
• Best Practices
• Demo
Fundamentals of RAML
5
Fundamentals of RAML
6
What is RAML ?
1. RAML stands for RESTful API Modeling Language.
2. It is a YAML based Language for describing RESTful APIs.
3. It provides a structured, clear format for describing an API.
4. It is designed to promote reuse, readability, and shared understanding among users.
Fundamentals of RAML
7
Why do we need RAML?
1. Clear documentation
2. Code Reusability
3. Collaboration
4. API Mocking
API Specification vs API Fragment
8
• An API fragment is a portion of an API specification, which is
why understanding it starts at the API specification level.
• An API specification consists of a plan of how your API should
look structurally.
API Fragment
9
API fragments are reusable component of RAML to make the
design and build of a reusable API even quicker and easier.
Another advantage of building an API spec out of reusable API
fragments is that consistency of definitions reduces the effort of
implementing APIs.
10
Different types of API Fragment
11
Traits
• Mulesoft traits, serves as a powerful tool for enhancing integration
projects.
• A “trait” typically refers to a reusable configuration or behaviour that
you can apply to one or more elements within your mulesoft project.
• Traits are a way to define a set of common properties,
configurations, or behaviours that can be shared among different
components, such as connectors, flows, and error handlers.
• They enhance the reusability and maintainability of your integration
projects by allowing you to define common settings in a central
location and apply them consistently.
Different types of API Fragment
12
Library
• A library is a RAML fragment that contains reusable definitions and
can be included in other API specifications as well.
• Example: A library could contain dataTypes, traits, and
resourceTypes that are common across multiple APIs.
• Benefits: Libraries help in organizing and maintaining common
definitions in a central place.
Different types of API Fragment
13
DataTypes
• DataTypes in RAML fragment are way to define the structure of
data that is sent or received.
• Example: A datatype could define a ‘User’ object with properties
such as ‘name’, ‘email’ and ‘age’.
• Benefits: DataTypes ensure the consistency of data structure
across the API and can be reused across multiple APIs.
Different types of API Fragment
14
Examples
• Examples are a way to shoe a sample payload for a method in your
API.
• Example: An example of a ‘User’ datatype could show a sample
JSON object with ‘name’, ‘email’ and ‘age’.
• Benefits: Examples provide a way for developers to understand the
expected request or response structure.
Different types of API Fragment
15
Resource Type
• Resource types are reusable components that can be applied to
multiple resources.
• Example: A resource type could define a ‘collection’ of items with
‘get’, ‘post’, ‘put’, and ‘delete’ methods.
• Benefits: Resource Types allow for the reuse of common resource
behaviours and reduce the need for repeated specification.
Different types of API Fragment
16
Security Scheme
• Security schemes are defined ways to secure an API and can be
applied to multiple methods or resources.
• Example: A security scheme could define an OAuth 2.0 security
flow.
• Benefits: Security schemes ensure the consistency of API security
and can be reused across multiple APIs.
Best Practices
● Start with the API Consumer in mind
● Use Restful principles
● Utilize API Fragments
● Follow consistent naming conventions
● Use HTTP status codes appropriately
● Leverage API-led connectivity
● Version your APIs
● Secure your APIs
● Documentation
17
Reference
18
 Overview of API Fragments Design Strategies | MuleSoft Blog
 RAML 101: Libraries and DataTypes Fragments | by Jonathan
Stoikovitch | RAML by Example | Medium
 API Best Practices: How to Design and Manage APIs | MuleSoft
 API Fragments and Why They Matter – PlektonLabs
 Why API Specs Are the Backbone of Successful Development |
Ready, Set, Cloud! (readysetcloud.io)
Q & A Session
Thank you

More Related Content

Similar to Dublin_mulesoft_meetup_API_specifications.pptx

Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Shelly Megan
 
08 hopex v next service fabric
08 hopex v next   service fabric08 hopex v next   service fabric
08 hopex v next service fabricMichel Bruchet
 
12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready SolutionsKashif Ali Siddiqui
 
SLASH IMAGINE: The #1 Midjourney API.pdf
SLASH IMAGINE: The #1 Midjourney API.pdfSLASH IMAGINE: The #1 Midjourney API.pdf
SLASH IMAGINE: The #1 Midjourney API.pdfVograce
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern LaunguageInho Kang
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Callon Campbell
 
SpringCloudConfig.pptx.pdf
SpringCloudConfig.pptx.pdfSpringCloudConfig.pptx.pdf
SpringCloudConfig.pptx.pdfKnoldus Inc.
 
Django Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIDjango Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIMarcos Pereira
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
APIs from the Edge to the Mesh
APIs from the Edge to the MeshAPIs from the Edge to the Mesh
APIs from the Edge to the MeshNordic APIs
 
Unit 5- Cloud Applications.pdf
Unit 5- Cloud Applications.pdfUnit 5- Cloud Applications.pdf
Unit 5- Cloud Applications.pdfMaryJacob24
 
Exploiting the value of Dublin Core through pragmatic development
Exploiting the value of Dublin Core through pragmatic developmentExploiting the value of Dublin Core through pragmatic development
Exploiting the value of Dublin Core through pragmatic developmentPaul Walk
 
Project_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxProject_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxskhushi9980
 
Creating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleepCreating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleepMike Anderson
 
Laravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive GuideLaravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive Guidedeep9753ak
 

Similar to Dublin_mulesoft_meetup_API_specifications.pptx (20)

Api design part 1
Api design part 1Api design part 1
Api design part 1
 
Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!
 
08 hopex v next service fabric
08 hopex v next   service fabric08 hopex v next   service fabric
08 hopex v next service fabric
 
12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions
 
SLASH IMAGINE: The #1 Midjourney API.pdf
SLASH IMAGINE: The #1 Midjourney API.pdfSLASH IMAGINE: The #1 Midjourney API.pdf
SLASH IMAGINE: The #1 Midjourney API.pdf
 
Rails interview questions
Rails interview questionsRails interview questions
Rails interview questions
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
 
Who Should Consider Using Laravel for Web Development?
Who Should Consider Using Laravel for Web Development?Who Should Consider Using Laravel for Web Development?
Who Should Consider Using Laravel for Web Development?
 
SpringCloudConfig.pptx.pdf
SpringCloudConfig.pptx.pdfSpringCloudConfig.pptx.pdf
SpringCloudConfig.pptx.pdf
 
Django Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIDjango Rest Framework - Building a Web API
Django Rest Framework - Building a Web API
 
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...
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
APIs from the Edge to the Mesh
APIs from the Edge to the MeshAPIs from the Edge to the Mesh
APIs from the Edge to the Mesh
 
Unit 5- Cloud Applications.pdf
Unit 5- Cloud Applications.pdfUnit 5- Cloud Applications.pdf
Unit 5- Cloud Applications.pdf
 
Exploiting the value of Dublin Core through pragmatic development
Exploiting the value of Dublin Core through pragmatic developmentExploiting the value of Dublin Core through pragmatic development
Exploiting the value of Dublin Core through pragmatic development
 
Project_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxProject_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptx
 
Creating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleepCreating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleep
 
Laravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive GuideLaravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive Guide
 

Recently uploaded

Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 

Recently uploaded (20)

Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 

Dublin_mulesoft_meetup_API_specifications.pptx

  • 1. April 04, 2024 Dublin MuleSoft Meetup Group API Design using Anypoint Studio
  • 2. #MuleSoftMeetups Organizers Kunal Gupta has over 9 years of dedicated work experience in Integration Development, Execution, and Delivery. Extensive involvement in diverse project implementations, placing a strong emphasis on API Management, including Analysis, Design, Development, and Implementation. Linkedin - Kunal Gupta | LinkedIn
  • 3. Speaker 3 Afreen is a MuleSoft mentor and working as a Mulesoft Developer at Zurich Insurance. She has great experience in Integration, development, execution and delivery using the MuleSoft products and offerings. Afreen has completed the following certifications - 1. MCD Level 1 2. MCPA and MCIA Linkedin - Afreen Fatma | LinkedIn
  • 4. 4 AGENDA • Introduction: Fundamentals of RAML • API Specification vs API Fragment • Different fragment types and their usage 1. Traits 2. Library 3. Data Type 4. Examples 5. Resource Type 6. Security Scheme • Best Practices • Demo
  • 6. Fundamentals of RAML 6 What is RAML ? 1. RAML stands for RESTful API Modeling Language. 2. It is a YAML based Language for describing RESTful APIs. 3. It provides a structured, clear format for describing an API. 4. It is designed to promote reuse, readability, and shared understanding among users.
  • 7. Fundamentals of RAML 7 Why do we need RAML? 1. Clear documentation 2. Code Reusability 3. Collaboration 4. API Mocking
  • 8. API Specification vs API Fragment 8 • An API fragment is a portion of an API specification, which is why understanding it starts at the API specification level. • An API specification consists of a plan of how your API should look structurally.
  • 9. API Fragment 9 API fragments are reusable component of RAML to make the design and build of a reusable API even quicker and easier. Another advantage of building an API spec out of reusable API fragments is that consistency of definitions reduces the effort of implementing APIs.
  • 10. 10
  • 11. Different types of API Fragment 11 Traits • Mulesoft traits, serves as a powerful tool for enhancing integration projects. • A “trait” typically refers to a reusable configuration or behaviour that you can apply to one or more elements within your mulesoft project. • Traits are a way to define a set of common properties, configurations, or behaviours that can be shared among different components, such as connectors, flows, and error handlers. • They enhance the reusability and maintainability of your integration projects by allowing you to define common settings in a central location and apply them consistently.
  • 12. Different types of API Fragment 12 Library • A library is a RAML fragment that contains reusable definitions and can be included in other API specifications as well. • Example: A library could contain dataTypes, traits, and resourceTypes that are common across multiple APIs. • Benefits: Libraries help in organizing and maintaining common definitions in a central place.
  • 13. Different types of API Fragment 13 DataTypes • DataTypes in RAML fragment are way to define the structure of data that is sent or received. • Example: A datatype could define a ‘User’ object with properties such as ‘name’, ‘email’ and ‘age’. • Benefits: DataTypes ensure the consistency of data structure across the API and can be reused across multiple APIs.
  • 14. Different types of API Fragment 14 Examples • Examples are a way to shoe a sample payload for a method in your API. • Example: An example of a ‘User’ datatype could show a sample JSON object with ‘name’, ‘email’ and ‘age’. • Benefits: Examples provide a way for developers to understand the expected request or response structure.
  • 15. Different types of API Fragment 15 Resource Type • Resource types are reusable components that can be applied to multiple resources. • Example: A resource type could define a ‘collection’ of items with ‘get’, ‘post’, ‘put’, and ‘delete’ methods. • Benefits: Resource Types allow for the reuse of common resource behaviours and reduce the need for repeated specification.
  • 16. Different types of API Fragment 16 Security Scheme • Security schemes are defined ways to secure an API and can be applied to multiple methods or resources. • Example: A security scheme could define an OAuth 2.0 security flow. • Benefits: Security schemes ensure the consistency of API security and can be reused across multiple APIs.
  • 17. Best Practices ● Start with the API Consumer in mind ● Use Restful principles ● Utilize API Fragments ● Follow consistent naming conventions ● Use HTTP status codes appropriately ● Leverage API-led connectivity ● Version your APIs ● Secure your APIs ● Documentation 17
  • 18. Reference 18  Overview of API Fragments Design Strategies | MuleSoft Blog  RAML 101: Libraries and DataTypes Fragments | by Jonathan Stoikovitch | RAML by Example | Medium  API Best Practices: How to Design and Manage APIs | MuleSoft  API Fragments and Why They Matter – PlektonLabs  Why API Specs Are the Backbone of Successful Development | Ready, Set, Cloud! (readysetcloud.io)
  • 19. Q & A Session