Skip to content

Example of how to build polyglot SDKs on top of OpenAPI

Notifications You must be signed in to change notification settings

eli-lim/polyglot-sdk-openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acme Petstore API

Problem

  • We have an API server.
  • We want to provide SDKs for multiple languages, so that more developers can easily interact with our API (who wants to write raw, untyped HTTP requests?!).
  • Maintaining SDKs for multiple languages is a pain, because type bindings and documentation need to be kept in sync.

Solution

  • Maintain an OpenAPI spec for our API.
  • The spec is the source of truth for our API.
  • Generate clients for multiple languages from the spec; type bindings and documentation are always in sync. Build on top of the generated clients to provide a more idiomatic SDK for each language.
      graph LR
          A[API Server] -->|produces| B[OpenAPI Spec]
          B -->|code gen| C[Python Client]
          B -->|code gen| D[Java Client]
          B -->|code gen| E[Javascript Client]
          B -->|code gen| F[Go Client]
          C --> G[Python SDK]
          D --> H[Java SDK]
          E --> I[Javascript SDK]
          F --> J[Go SDK]
    
    Loading

About

Example of how to build polyglot SDKs on top of OpenAPI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published