Review of the tools for generating typscript types and data validation from OpenAPI specifications.
This repository is derived from developing TypeScript Types and Data Validation for the OpenADR 3 specification. In that project, it wasn't clear which tool was best for auto-generating these artifacts, and therefore I started reviewing all such tools. After a while some specific tools were chosen, and then what does one do with the evaluations. It didn't make sense to keep the notes for evaluating those tools in that repository, and therefore this repository was created.
The goal (user story) is that - Software engineers who define APIs using OpenAPI are well-served with autogenerated type declarations and autogenerated data validation code.
Those two things are the basis of writing sound code related to an API. It's also useful to autogenerate both client and server skeleton code which then makes use of the type declarations and data validation. But that's for a different project.
This repository contains notes from evaluating different software tools for converting OpenAPI specifications into TypeScript type declarations and data validation code.
First - the ever-present Petstore example, Swagger Petstore is used because of wide familiarity.
Second - My own purpose is that I am working within the team developing OpenADR 3.x. As of this writing the OpenADR specification is not publicly released, though it is easy to access via the OpenADR Foundation website (openadr.com
).
This repository contains a tree of directories with one per tool.
The top-level directory contains a package.json
, tsconfig.json
, to support installing TypeScript, zx, and any other tool used across the board.
Each directory will contain a package.json
to support the tool evaluated in that directory.
Because of the algorithm for finding Node.js packages, the TypeScript (etc) tools in the top-level directory are useful for any subdirectory and it is not required to reinstall these tools in every directory.