Unlocking API Interoperability: Converting OpenAPI to TypeScript JSON Schema

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • Appwrite - The open-source backend cloud platform
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    Since the OpenAPI Specification is a "machine-readable interface definition language for describing, [...] web services", and TypeScript is practically the only available type solution for Node.js, I confidently googled:

  • openapi-ts-json-schema

    OpenAPI to TypeScript JSON schema generator.

    After an initial attempt to manually replace the $refs all around my JSON schemas, I ended up putting together a few lines to automate the process which I eventually abstracted into a JS NPM package: openapi-ts-json-schema.

  • Appwrite

    Appwrite - The open-source backend cloud platform. Add Auth, Databases, Functions, and Storage to your product and build any application at any scale while using your preferred coding languages and tools.

  • json-schema-ref-parser

    Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers

    Resolve external/remote $refs and dereference them with @apidevtools/json-schema-ref-parser (resolving $ref's)

  • openapi-schema-to-json-schema

    Due to the OpenAPI v3.0 and JSON Schema discrepancy, you can use this JS library to convert OpenAPI Schema objects to proper JSON Schema. (by openapi-contrib)

    Convert to JSON schema with @openapi-contrib/openapi-schema-to-json-schema and openapi-jsonschema-parameters

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts