Deno typescript OpenAPI generators
Created by: anxiousmodernman
Description
Deno is a new TypeScript runtime built with V8 and Rust. Generating clients and servers from OpenAPI specifications would be a great feature.
The existing TypeScript fetch implementation should work for generating clients, with some modifications. I have done some research to this effect with the spec for Kubernetes. Some of the changes required to get the Deno code to build.
- change imports to be ".ts" instead of no file extension
- when importing directory "modules", point the import at "blah/index.ts" instead of just "blah" (the directory)
- alias the standard DOM types to the Deno dom types.
- Add the HEAD http method to the generated code (missing for some reason, perhaps a bug in the generator)
Deno strives for browser compatibility, so the fetch implementation is built in. But there are other networking capabilities being developed for Deno, such as dialTLS
builtins. The fetch api is probably where authors of OpenAPI generators should focus first, however, as that API is well defined and is unlikely to change in big ways, I imagine.
Generating server-side Deno is something that is feasible, but that API is more likely to change.