2

I need to generate client libraries from Swagger JSON in different languages (Javascript in my case) from within the code of my .NET application.

I tried to send POST request to swagger online codegen but it's not very reliable method to retrieve an API lib.

It should be something like codeGenerator.Generate("url to swagger JSON") => file received.

Greg
  • 21
  • 3

1 Answers1

0

This online tool offers an API client generator for a multitude of languages including JavaScript

it also supports openapi version 3.0.1 which is what swagger V5 now produces

Steps

  1. Run your API and view the swagger UI
  2. view the JSON using the link on the swagger UI -> /swagger/v1/swagger.json
  3. Copy this JSON
  4. Open this tool at -> https://editor.swagger.io/ and paste in your JSON
  5. Select Generate Client and then your desired language (JavaScript in your case)
JGilmartin
  • 8,683
  • 14
  • 66
  • 85