Nedgeva / swagger-codegen-ts-ui

swagger-codegen-ts ported to client-side

Home Page:https://nedgeva.github.io/swagger-codegen-ts-ui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swagger-codegen-ts-ui

Web UI for swagger-codegen-ts.

What

This is the (missing) web UI for swagger-codegen-ts. Actually this is whole codegen app ported to client side, no BE required.

How to use

Just open https://nedgeva.github.io/swagger-codegen-ts-ui/ and drag-drop your yaml OpenAPI/Swagger spec right to target place. If everything is ok you'll see generated file tree in virtual FS. You're free to inspect each file, export whole output to CodeSandbox or save locally as zipped archive.

How to build

Originally swagger-codegen-ts targets NodeJS runtime so it's wasn't planned to run in browser. Therefore shimming of some Node built-ins is required to properly work on client side. At the core of it's dependencies swagger-codegen-ts-ui uses BrowserFS which handles requests to Node API like fs, path, process etc, and provides layer to work with it's own virtual FS. Other shims are covered by Parcel - the build tool.

Besides shimming, some dependencies requires patching to be able successfuly operate in the browser environment. You can refer to patches folder in project dir (*). Patches should be applied automatically by well-known workaround tool patch-package once packages installed, no extra work required.

So building as easy as:

  1. cloning this repo
  2. running yarn
  3. and finally yarn build

Then check output in /dist folder.

(*) client-side app also forces swagger-codegen-ts to use newer version of Prettier by aliasing dependencies and applying little patch to it's internals, so be aware when building against different versions of swagger-codegen-ts.

About

swagger-codegen-ts ported to client-side

https://nedgeva.github.io/swagger-codegen-ts-ui/


Languages

Language:TypeScript 97.2%Language:HTML 1.2%Language:CSS 0.9%Language:JavaScript 0.7%