SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von apidays

Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...apidays
 
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...apidays
 
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...apidays
 
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...apidays
 
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...apidays
 
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...apidays
 
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...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
 

Mehr von apidays (20)

Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
 
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
 
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
 
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
 
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
 
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
 
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
 
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 ...
 

Kürzlich hochgeladen

定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
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
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 

Kürzlich hochgeladen (20)

定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
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
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
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...
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 

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.