What's new
NoobsPlanet

Join our community today and enjoy an ad-free experience. Ask questions or learn about anything related to technology!

Dart Swagger File Generator Using OpenAPI Generator

Nikesh

Administrator
Staff member
Download openapi-generator-cli.jar , and assuming you have downloaded it in Downloads folder. Once the download is complete, from your project terminal run the following command.

Bash:
java -jar ~/Downloads/openapi-generator-cli-7.8.0.jar generate \
  -i specs/swagger.yaml \
  -g dart-dio \
  -o api-client/
It will show some verbose message printing in computer screen that will take few seconds to complete. Then, go inside the api-client folder and run pub get and build_runner.
Bash:
cd api-client
flutter pub get
flutter pub run build_runner build
 
Top