main function

void main(
  1. List<String> arguments
)

Entry point for the application.

Takes a list of command line arguments where the first argument should be the path to the Swagger file or a URL to the Swagger specification.

Example:

dart run main.dart path/to/swagger.json

Or with a remote URL:

dart run main.dart https://api.example.com/swagger.json

Implementation

void main(List<String> arguments) async {
  if (arguments.isEmpty) {
    printWarning('Usage: dart run main.dart [path_to_swagger.json]');
    return;
  }
  await swaggerGenerator(
    arguments[0],
  );
}