SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
OpenAPI Bes t Pract ices
for generat ing SDKs
Sid Maes t re
VP Developer Relations @APIMatic
Benefits of generated SDKs
● Your API definition is the source of truth
● Updates can be rolled out in multiple SDKs.
● Building SDKs and documentation part of your CI/ CD pipeline.
● Updates are more accurate and less time consuming.
● Focus engineering resources on building new features, not SDKs.
3 ways to create an API definition
Manually Annotation HTTP Traffic
Converting your definition
Validate your definition
Pitfall #1
Omitting operation ids
/pets:
post:
tags:
- pets
summary: Updates a pet in the store with form data
description: Updates an existing pet and characteristics
parameters: []
… or duplicate operation id
/pets:
post:
operationId: updatePet
summary: Updates a pet in the store with form data
put:
operationId: updatePet
summary: Updates a pet in the store with form data
include a unique operation id
/pets:
post:
tags:
- pets
summary: Updates a pet in the store with form data
operationId: updatePet
description: Updates an existing pet and characteristics
parameters: []
Spectral with standard ruleset
● Duplicate operationId (error)
● No operation Id (warning)
💡💡 Tips for naming your operationId
● Use name pattern of a verb + object/ resource.
● Aim to be 30 characters or less
● Avoid using stop words like "a", "the" and "and" in the name.
● createPet / updatePet / listPets
Pitfall #2
Omitting tags from operations
/pets:
post:
summary: Updates a pet in the store with form data
operationId: updatePet
description: Updates an existing pet and characteristics
parameters: []
/pets:
Post:
tags:
- pets
summary: Updates a pet in the store with form data
operationId: updatePet
description: Updates an existing pet and characteristics
parameters: []
Spectral with standard ruleset
● Operations missing tag property (warning)
💡💡 Tips for naming tags
● Identify the ideal groupings for your methods.
● Pluralize all names unless they are singleton resources.
● Aim to be 30 characters or less
● petsController
Pitfall #3
Poorly written or no descriptions
The following should have descriptions
● Info
● Tag
● Operations and Parameters
● Request body
● Response content
● Schema and schema properties
Spectral with standard ruleset
● Response content (error)
● Info (warning)
● Tag (warning)
● Operations (warning) and Parameters
● Request body
● Schema and schema properties
💡💡 Tips for writing good descriptions
● Describe the element and mention any edge cases that may occur
● Avoid short descriptions that don’t add value.
Describe the response from the listPets operation
⛔ description: list response
✅ description: A paged array of pets
Pitfall #4
Defining objects or enums inline
public List<PetsResponse> listPets(
final Integer limit) throws ApiException, IOException {
return prepareListPetsRequest(limit).execute();
}
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
name:
petType:
public List<Pet> listPets(
final Integer limit) throws ApiException, IOException {
return prepareListPetsRequest(limit).execute();
}
Define them as reusable components
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
Spectral with standard ruleset
● None
💡💡 Tips for naming objects
● Use singular unless it represents some kind of collection of things
● Do not prefix or postfix based on their schema type.
⛔ PetsResponse
⛔ PetObject
✅ Pet
Pitfall #5
Forgetting examples
The following should have examples
● Parameters
● Request body
● Response content
● Schema and schema properties
@Test
public void testTestUpdatePet() throws Exception {
Pet body = ApiHelper.deserialize(
"{"id":12345,"name":"Indiana","petType":"dog"}",
Pet.class);
try {
controller.updatePet(body);
} catch (ApiException e) {
// Empty block
}
assertNotNull("Response is null",
httpResponse.getResponse());
assertEquals("Status is not 201",
201, httpResponse.getResponse().getStatusCode());
Spectral with standard ruleset
● None
10 Traps
SDK generators
Questions?
apidays New York 2023 - OpenAPI Best Practices for Generating SDKs, Sid Maestre, APIMatic

Más contenido relacionado

Similar a apidays New York 2023 - OpenAPI Best Practices for Generating SDKs, Sid Maestre, APIMatic

R12 d49656 gc10-apps dba 09
R12 d49656 gc10-apps dba 09R12 d49656 gc10-apps dba 09
R12 d49656 gc10-apps dba 09zeesniper
 
Dhanasekaran 2008-2009 Quick Test Pro Presentation
Dhanasekaran 2008-2009 Quick Test Pro PresentationDhanasekaran 2008-2009 Quick Test Pro Presentation
Dhanasekaran 2008-2009 Quick Test Pro PresentationDhanasekaran Nagarajan
 
First QTP Tutorial
First QTP TutorialFirst QTP Tutorial
First QTP Tutorialtjdhans
 
QTP Tutorial Slides Presentation.
QTP Tutorial Slides Presentation.QTP Tutorial Slides Presentation.
QTP Tutorial Slides Presentation.Jaya Priya
 
Configure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaConfigure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaAnatole Tresch
 
06 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa1606 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa16John Todora
 
MaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit SolutionMaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit SolutionHelen Fisher
 
Boost your App with Gatling
Boost your App with GatlingBoost your App with Gatling
Boost your App with GatlingKnoldus Inc.
 
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...Amazon Web Services
 
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle ContestDA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle ContestBerker Kozan
 
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...Agile Testing Alliance
 
Lemur Tutorial at SIGIR 2006
Lemur Tutorial at SIGIR 2006Lemur Tutorial at SIGIR 2006
Lemur Tutorial at SIGIR 2006pogil
 
PA I Session I Recap
PA I Session I RecapPA I Session I Recap
PA I Session I Recapaiclub_slides
 
Interview qutions
Interview qutionsInterview qutions
Interview qutionssatyaragha
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 differencevenki_venki
 
Making Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterMaking Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterEDB
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design PrinciplesAnji Beeravalli
 
Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)
Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)
Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)Ontico
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing ServicesLeigh Dodds
 

Similar a apidays New York 2023 - OpenAPI Best Practices for Generating SDKs, Sid Maestre, APIMatic (20)

R12 d49656 gc10-apps dba 09
R12 d49656 gc10-apps dba 09R12 d49656 gc10-apps dba 09
R12 d49656 gc10-apps dba 09
 
Dhanasekaran 2008-2009 Quick Test Pro Presentation
Dhanasekaran 2008-2009 Quick Test Pro PresentationDhanasekaran 2008-2009 Quick Test Pro Presentation
Dhanasekaran 2008-2009 Quick Test Pro Presentation
 
First QTP Tutorial
First QTP TutorialFirst QTP Tutorial
First QTP Tutorial
 
QTP Tutorial Slides Presentation.
QTP Tutorial Slides Presentation.QTP Tutorial Slides Presentation.
QTP Tutorial Slides Presentation.
 
Configure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaConfigure Your Projects with Apache Tamaya
Configure Your Projects with Apache Tamaya
 
06 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa1606 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa16
 
MaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit SolutionMaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit Solution
 
Boost your App with Gatling
Boost your App with GatlingBoost your App with Gatling
Boost your App with Gatling
 
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
 
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle ContestDA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
 
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
 
Lemur Tutorial at SIGIR 2006
Lemur Tutorial at SIGIR 2006Lemur Tutorial at SIGIR 2006
Lemur Tutorial at SIGIR 2006
 
PA I Session I Recap
PA I Session I RecapPA I Session I Recap
PA I Session I Recap
 
Pa1 session 1_recap
Pa1 session 1_recapPa1 session 1_recap
Pa1 session 1_recap
 
Interview qutions
Interview qutionsInterview qutions
Interview qutions
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 difference
 
Making Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterMaking Postgres Central in Your Data Center
Making Postgres Central in Your Data Center
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design Principles
 
Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)
Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)
Postgres в основе вашего дата-центра, Bruce Momjian (EnterpriseDB)
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 

Más de apidays

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
 
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...apidays
 
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...apidays
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...apidays
 
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...apidays
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...apidays
 
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...apidays
 
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...apidays
 
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBMApidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBMapidays
 
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...apidays
 
Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...apidays
 
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...apidays
 
Apidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHub
Apidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHubApidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHub
Apidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHubapidays
 
Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...
Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...
Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...apidays
 
apidays Australia 2023 - A programmatic approach to API success including Ope...
apidays Australia 2023 - A programmatic approach to API success including Ope...apidays Australia 2023 - A programmatic approach to API success including Ope...
apidays Australia 2023 - A programmatic approach to API success including Ope...apidays
 
apidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile API
apidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile APIapidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile API
apidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile APIapidays
 
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wiseapidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wiseapidays
 
apidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Ventures
apidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Venturesapidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Ventures
apidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Venturesapidays
 

Más de apidays (20)

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 Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
 
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
 
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
 
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
 
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
 
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBMApidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
 
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
 
Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...
 
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
 
Apidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHub
Apidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHubApidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHub
Apidays Singapore 2024 - API : New Economy for Telcos by Rajesh Mhatre, StarHub
 
Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...
Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...
Apidays Singapore 2024 - The Nuance of Quantifying Digital Carbon Emissions b...
 
apidays Australia 2023 - A programmatic approach to API success including Ope...
apidays Australia 2023 - A programmatic approach to API success including Ope...apidays Australia 2023 - A programmatic approach to API success including Ope...
apidays Australia 2023 - A programmatic approach to API success including Ope...
 
apidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile API
apidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile APIapidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile API
apidays Singapore 2023 - Addressing the Data Gap, Jerome Eger, Smile API
 
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wiseapidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
 
apidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Ventures
apidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Venturesapidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Ventures
apidays Singapore 2023 - Banking the Ecosystem, Apurv Suri, SC Ventures
 

Último

Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxTanveerAhmed817946
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 

Último (20)

Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptx
 
Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 

apidays New York 2023 - OpenAPI Best Practices for Generating SDKs, Sid Maestre, APIMatic

  • 1. OpenAPI Bes t Pract ices for generat ing SDKs Sid Maes t re VP Developer Relations @APIMatic
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Benefits of generated SDKs ● Your API definition is the source of truth ● Updates can be rolled out in multiple SDKs. ● Building SDKs and documentation part of your CI/ CD pipeline. ● Updates are more accurate and less time consuming. ● Focus engineering resources on building new features, not SDKs.
  • 12. 3 ways to create an API definition Manually Annotation HTTP Traffic
  • 15.
  • 17. /pets: post: tags: - pets summary: Updates a pet in the store with form data description: Updates an existing pet and characteristics parameters: []
  • 18. … or duplicate operation id /pets: post: operationId: updatePet summary: Updates a pet in the store with form data put: operationId: updatePet summary: Updates a pet in the store with form data
  • 19. include a unique operation id /pets: post: tags: - pets summary: Updates a pet in the store with form data operationId: updatePet description: Updates an existing pet and characteristics parameters: []
  • 20. Spectral with standard ruleset ● Duplicate operationId (error) ● No operation Id (warning)
  • 21. 💡💡 Tips for naming your operationId ● Use name pattern of a verb + object/ resource. ● Aim to be 30 characters or less ● Avoid using stop words like "a", "the" and "and" in the name. ● createPet / updatePet / listPets
  • 22. Pitfall #2 Omitting tags from operations
  • 23. /pets: post: summary: Updates a pet in the store with form data operationId: updatePet description: Updates an existing pet and characteristics parameters: []
  • 24. /pets: Post: tags: - pets summary: Updates a pet in the store with form data operationId: updatePet description: Updates an existing pet and characteristics parameters: []
  • 25. Spectral with standard ruleset ● Operations missing tag property (warning)
  • 26. 💡💡 Tips for naming tags ● Identify the ideal groupings for your methods. ● Pluralize all names unless they are singleton resources. ● Aim to be 30 characters or less ● petsController
  • 27. Pitfall #3 Poorly written or no descriptions
  • 28. The following should have descriptions ● Info ● Tag ● Operations and Parameters ● Request body ● Response content ● Schema and schema properties
  • 29. Spectral with standard ruleset ● Response content (error) ● Info (warning) ● Tag (warning) ● Operations (warning) and Parameters ● Request body ● Schema and schema properties
  • 30. 💡💡 Tips for writing good descriptions ● Describe the element and mention any edge cases that may occur ● Avoid short descriptions that don’t add value. Describe the response from the listPets operation ⛔ description: list response ✅ description: A paged array of pets
  • 31. Pitfall #4 Defining objects or enums inline
  • 32. public List<PetsResponse> listPets( final Integer limit) throws ApiException, IOException { return prepareListPetsRequest(limit).execute(); } content: application/json: schema: type: array items: type: object properties: id: name: petType:
  • 33. public List<Pet> listPets( final Integer limit) throws ApiException, IOException { return prepareListPetsRequest(limit).execute(); } Define them as reusable components content: application/json: schema: $ref: '#/components/schemas/Pet'
  • 34. Spectral with standard ruleset ● None
  • 35. 💡💡 Tips for naming objects ● Use singular unless it represents some kind of collection of things ● Do not prefix or postfix based on their schema type. ⛔ PetsResponse ⛔ PetObject ✅ Pet
  • 37. The following should have examples ● Parameters ● Request body ● Response content ● Schema and schema properties
  • 38.
  • 39.
  • 40. @Test public void testTestUpdatePet() throws Exception { Pet body = ApiHelper.deserialize( "{"id":12345,"name":"Indiana","petType":"dog"}", Pet.class); try { controller.updatePet(body); } catch (ApiException e) { // Empty block } assertNotNull("Response is null", httpResponse.getResponse()); assertEquals("Status is not 201", 201, httpResponse.getResponse().getStatusCode());
  • 41. Spectral with standard ruleset ● None
  • 44.
  • 45.