Soroush Neyestani

Software Engineer

Application Architect

Enterprise Application Developer

Technical Author & Educator

OpenAPI SDK Generator

Engineering Reproducible, Type-Safe API Clients with OpenAPI, TypeScript, and Python

An open-source software engineering case study
Author: Soroush Neyestani
Version: v0.1.0 — November 2026
Category: Backend Engineering / API Architecture / Developer Tooling
Technologies: OpenAPI 3.0.3, OpenAPI Generator 7.28.0, TypeScript Fetch, Python urllib3, Node.js, npm, Pydantic, GitHub Actions
License: MIT for original project code; relevant generated components retain their applicable license and attribution notices
Status: Completed — Public Release

Repository: https://github.com/soroushneyestani/openapi-sdk-generator-reference
Official release: https://github.com/soroushneyestani/openapi-sdk-generator-reference/releases/tag/v0.1.0


Executive Summary

An API contract becomes valuable when the applications consuming it can reliably depend on its behavior. In systems with consumers written in multiple programming languages, independently maintained client libraries tend to drift in their models, serialization, error handling, and version expectations.

Generating source code from an OpenAPI specification reduces that duplication, but it does not by itself prove that the resulting clients compile, install, work against a real server, or remain compatible when the specification evolves.

I developed OpenAPI SDK Generator as an open-source workflow that connects those engineering stages. A single OpenAPI 3.0.3 contract is processed by OpenAPI Generator 7.28.0 to produce two client libraries: TypeScript Fetch and Python urllib3. Each is built into an installable package and exercised against an actual synthetic HTTP provider.

The project additionally verifies consumer expectations, compatible and breaking API changes, a documented semantic-versioning policy, repeatable generation, cross-platform behavior, and the integrity of the published source distribution.

The goal was not to rewrite the upstream code-generation engine. It was to build and verify the workflow around it: from specification to SDK, from SDK to working consumer, and from contract change to compatibility evidence.

1. The Engineering Problem

Consider a REST API consumed by a TypeScript application and a Python application. Both need compatible operation definitions, data models, authentication behavior, and error responses. Without a shared source of truth, developers may duplicate request models, manually maintain endpoint lists, and introduce incompatible assumptions.

OpenAPI supplies a machine-readable description of an HTTP interface and makes source generation possible. But important questions remain:

  • Does the generated SDK compile and package correctly?
  • Can a consumer install the package rather than just import files from the generator’s output directory?
  • Are path and query parameters encoded correctly?
  • Do JSON serialization, authentication, and structured errors behave correctly?
  • How do clients handle incomplete responses, invalid JSON, and timeouts?
  • Does an older consumer still work when the API changes?
  • Can an unchanged specification regenerate stable output on Windows and Ubuntu?

A successful generation command answers none of these questions by itself. Generated code must be verified as a usable software dependency, not merely accepted as a directory of source files.

2. Engineering Objectives

The initial release had six central objectives:

  1. One authoritative contract: generate both SDKs from a shared OpenAPI definition.
  2. Two working clients: compile, package, install, and execute actual HTTP interactions.
  3. Consumer-driven verification: test observable behavior against the running provider.
  4. Contract evolution: demonstrate compatible and breaking changes affecting real consumers.
  5. Reproducible generation: independently regenerate and compare outputs.
  6. Cross-platform evidence: run the complete workflow on Windows and Ubuntu and bind results to the published source revision.

3. Technology Stack and Design Choices

ComponentVersion / implementationPurpose
API specificationOpenAPI 3.0.3Shared machine-readable contract
Generator engineOpenAPI Generator 7.28.0Language-specific client generation
TypeScript clientTypeScript FetchTyped Fetch-based HTTP client
Python clientPython urllib3Python HTTP client with generated models
TypeScript5.9.3Strict compilation
Node.js24.19.0TypeScript build and test environment
npm11.17.0Package creation and local installation
Python3.13.17Python build and verification
PydanticGenerated model validationRuntime data-model checks
GitHub ActionsWindows 2025 / Ubuntu 24.04Automated independent verification

Why OpenAPI? It provides a language-independent representation of paths, operations, parameters, request bodies, response schemas, and related metadata.

Why use an existing generator? Implementing a complete OpenAPI parser, schema interpreter, template engine, and multiple language runtimes would be a different and far larger project. Here, original engineering effort focuses on generation orchestration, validation, packaging, integration, compatibility, and reproducibility.

Why TypeScript and Python? They expose different compile-time, runtime, serialization, and packaging concerns. Verification in both ecosystems is more informative than confirming that two output directories exist.

4. Architecture and Generation Pipeline

The project separates contract definition, generation, packaging, provider behavior, and verification:

            OpenAPI 3.0.3 Contract
                     |
           Validation and Config
                     |
         OpenAPI Generator 7.28.0
                 /       \
                v         v
       TypeScript Fetch   Python urllib3
              SDK             SDK
                |               |
         Strict Build       Wheel Build
         npm Install       Isolated Install
                |               |
                +-------+-------+
                        |
             Real Synthetic HTTP API
                        |
           Consumer Contract Verification
                        |
       Compatibility and Regeneration Tests
                        |
               CI and Release Evidence

A synthetic provider implements the required HTTP behavior and eliminates the need to test against employer or customer systems. Tests distinguish generator failures from invalid contracts, packaging defects, consumer incompatibility, and provider errors.

5. TypeScript Fetch SDK: Beyond Compilation

The TypeScript SDK is generated from the approved specification, compiled with strict type checking, built as an npm package, installed from the local package artifact, and used to communicate with the running provider.

Strict compilation helps catch invalid method names and type-level incompatibilities. It does not establish that external runtime JSON always conforms to the generated types. The integration tests therefore cover encoded path and query parameters, JSON bodies, authentication, optional and null values, structured error handling, incomplete responses, invalid JSON, and timeouts.

The reported public verification passed 14 TypeScript consumer tests per tested state, with 11 actual HTTP interactions per state. Those counts describe separate executions of the suite, not a single aggregate of unique tests.

6. Python urllib3 SDK: Installed Wheel Verification

The Python SDK uses urllib3 and generated Pydantic models. The build process creates a wheel, installs it in an isolated environment, checks dependencies, compiles bytecode, validates model behavior, and exercises actual HTTP requests.

Testing an installed wheel matters: a source directory may appear correct while the package lacks metadata, dependencies, or files required by a real consumer.

The public evidence reports 15 Python consumer tests per tested state, with 11 actual HTTP interactions per state. The different TypeScript and Python counts reflect different language-specific checks and do not imply that one SDK is inherently better.

7. Consumer-Driven Contract Verification

A syntactically valid OpenAPI document does not guarantee that application code consuming a regenerated client will continue working. The project makes consumer expectations executable against a running synthetic provider.

Tests exercise HTTP methods and paths, encoded parameters, request and response JSON, authentication, optional and nullable properties, structured errors, malformed replies, and timeouts.

Three tested consumer states were reported:

  1. Baseline: original consumer against the baseline API.
  2. Additive evolution: existing consumer against an extended, compatible API.
  3. Regenerated consumer: regenerated client against the extended API.

Each state reported 14 passing TypeScript tests and 15 passing Python tests, and each SDK recorded 11 real HTTP interactions per state. These verify the documented synthetic JSON contract and tested scenarios, not every possible OpenAPI feature.

8. Compatible Evolution: Optional displayHint

In the first compatibility experiment, an optional response field named displayHint was added. Both existing SDK consumers continued working against the updated provider; consumers built from the regenerated SDKs also passed.

This supports compatibility for this tested change and these clients. Under the project’s own pre-1.0 versioning policy, the additive example accepted an SDK candidate version of 0.2.0.

An optional property is not universally harmless: strict serializers, unknown-field rejection, runtime validation, language-specific generation rules, or consumer assumptions can change the outcome. The project relies on executable evidence rather than treating compatibility as automatic.

9. Breaking SDK Compatibility Without Changing the HTTP Route

The second experiment renamed an OpenAPI operationId from getWidget to fetchWidget while leaving the underlying HTTP route unchanged.

The old TypeScript consumer failed compilation against the regenerated SDK as expected. In Python, the former method name was absent from the regenerated client.

This demonstrates that HTTP endpoint compatibility is not identical to SDK source compatibility. Generated method names form part of a library’s public programming interface, even when the network route remains stable.

The project-specific compatibility policy selected 1.0.0 for the breaking-change example. This is not a universal Semantic Versioning requirement: during the 0.y.z initial-development phase, SemVer does not prescribe that every breaking change must move directly to 1.0.0.

10. Versioning and API Governance

The workflow distinguishes several independent version concepts:

  • OpenAPI specification version: the specification format, here 3.0.3.
  • API contract version: the version of the interface described by the contract.
  • SDK package version: the version distributed to an application consumer.
  • Generator engine version: OpenAPI Generator 7.28.0.
  • This project’s version: the toolkit release, v0.1.0.

The compatibility fixtures use 0.2.0 and 1.0.0 as experimental SDK-versioning outcomes, not as replacements for the published toolkit release version. A versioning decision should be supported by tests of actual consumers and by a clearly stated compatibility policy.

11. Reproducibility Across Windows and Ubuntu

Repeated generation from unchanged inputs was checked by comparing 77 generated files.

ComparisonVerified result
Windows, generation A vs. B77/77 byte-identical
Ubuntu, generation A vs. B77/77 byte-identical
Windows vs. Ubuntu75/77 byte-identical
Remaining cross-platform differencesTwo .openapi-generator/FILES manifests
Difference typeCRLF versus LF line endings

The result establishes deterministic regeneration within each tested OS, not byte-identical output across all platforms. Package hashes for the npm artifact and Python wheel were verified separately per job; cross-environment equality of package bytes is not assumed.

The two newline-only differences were preserved in the evidence rather than quietly normalized or hidden.

12. Public CI: Four Successful Platform Jobs

Both the public main and official release-tag workflows succeeded. Across those two workflow runs, four jobs completed on Windows 2025 and Ubuntu 24.04 using OpenAPI Generator 7.28.0, Node.js 24.19.0, npm 11.17.0, TypeScript 5.9.3, and Python 3.13.17.

Each job reported 28 passing source tests and verified the approved generation/build/install/consumer/compatibility/reproducibility workflow.

  • Main CI: https://github.com/soroushneyestani/openapi-sdk-generator-reference/actions/runs/46434985405
  • Release-tag CI: https://github.com/soroushneyestani/openapi-sdk-generator-reference/actions/runs/46435624609

These are public-source verification runs, distinct from earlier private-development evidence.

13. Input Validation and Security

A generator transforms structured input into source files and invokes build tools. It therefore needs clear restrictions on accepted specifications and references.

Reported negative tests rejected external references, invalid operation identifiers, and incomplete contract response definitions. The project documents its accepted JSON profile and security boundaries rather than presenting unrestricted support for arbitrary untrusted OpenAPI documents.

Gitleaks 8.30.1 reported zero findings in the independent public history and public CI scanning scope. That is a scoped secret-scan result, not a comprehensive vulnerability assessment.

The API provider and fixtures are synthetic and do not require real employer or customer endpoints.

14. Licensing and Attribution

Original project code is provided under the MIT License. OpenAPI Generator, the upstream engine, uses Apache License 2.0. The release report states that relevant generated SDK packages preserve Apache-2.0 license text and attribution notices, including applicable metadata and files in the Python wheel.

The generator’s license does not, by itself, determine the license of every generated file. Actual source headers, templates, bundled material, package metadata, and notices must be considered. The distribution includes the reported license and third-party notice files.

15. Release Engineering and Integrity

The public release was published in a separate repository with a reported single-root-commit history. Both main and the protected v0.1.0 tag identify the same source revision:

8156c37e32099bd2b4918719f96de5976aba990d

The public source ZIP contains 55 files, verified against the tagged Git tree.

SHA-256: 15afe49dedbb72fec652aa4128df85e3184ae887e46b50c5506f7939330e2020

According to the final release report, all six release attachments were downloaded without authentication and verified for size and SHA-256 integrity. Public branch/tag protections and successful CI evidence were also recorded. These identifiers allow the source archive, Git revision, workflows, and release evidence to be associated with the same published version.

16. Scope and Limitations

The project deliberately does not claim universal support:

  • Specification coverage: documented and tested OpenAPI 3.0.3 JSON profile, not every feature of every OpenAPI version.
  • Target SDKs: TypeScript Fetch and Python urllib3, not all upstream language generators.
  • Consumer tests: a synthetic provider and the documented test scenarios, not arbitrary external APIs.
  • Compatibility: one tested additive property and one tested operation rename, not a complete automated classification of all breaking changes.
  • Reproducibility: 77/77 repeated files within each OS, but 75/77 byte-identical across the two OSes.
  • Distribution: local npm and wheel installations were verified; the SDK packages were not claimed to be published to npm or PyPI.
  • Security: validation and secret scans were performed for their stated scope; no comprehensive certification is implied.

17. Practical Applications

The project offers an inspectable reference for:

  • Backend and API teams maintaining contracts for multiple client languages.
  • SDK engineers orchestrating generation, builds, packaging, and consumer tests.
  • API governance reviewing changes to operation identifiers and response schemas.
  • CI/CD engineers adding repeatable code-generation and compatibility gates.
  • Technical education exploring type safety, runtime validation, semantic versioning, HTTP contracts, and cross-platform determinism.

18. Potential Future Extensions

Possible work beyond v0.1.0 includes additional SDK languages, broader OpenAPI 3.1 coverage, more schema and media-type combinations, richer compatibility fixtures, automated contract-diff reporting, canonical generated metadata, more distribution formats, artifact attestations, and testing against multiple API release versions.

These are potential extensions, not shipped features of the current release.

Conclusion

OpenAPI SDK Generator v0.1.0 demonstrates that reliable SDK generation requires more than creating source files. A trustworthy engineering process must establish that clients compile, install, communicate with an actual provider, handle documented errors, and behave predictably as the API evolves.

The key lesson is the distinction between a valid OpenAPI specification, a working generated SDK, and a backward-compatible software dependency. They are related, but they are not interchangeable.

Combining code generation with executable consumer verification, compatibility examples, cross-platform reproducibility, and source-release integrity provides an auditable foundation for API client engineering.


Technical Resources

  • Repository: https://github.com/soroushneyestani/openapi-sdk-generator-reference
  • Official v0.1.0 release: https://github.com/soroushneyestani/openapi-sdk-generator-reference/releases/tag/v0.1.0
  • Main CI: https://github.com/soroushneyestani/openapi-sdk-generator-reference/actions/runs/46434985405
  • Release-tag CI: https://github.com/soroushneyestani/openapi-sdk-generator-reference/actions/runs/46435624609
  • SDK verification report: https://github.com/soroushneyestani/openapi-sdk-generator-reference/releases/download/v0.1.0/SDK_VERIFICATION.md
  • Machine-readable evidence: https://github.com/soroushneyestani/openapi-sdk-generator-reference/releases/download/v0.1.0/SDK_VERIFICATION.json
  • Source archive: https://github.com/soroushneyestani/openapi-sdk-generator-reference/releases/download/v0.1.0/openapi-sdk-generator-v0.1.0-source.zip
  • Checksums: https://github.com/soroushneyestani/openapi-sdk-generator-reference/releases/download/v0.1.0/SHA256SUMS.txt

OpenAPI SDK Generator — v0.1.0 | November 2026 | OpenAPI · TypeScript · Python · GitHub Actions