swagger_parser 0.2.4 copy "swagger_parser: ^0.2.4" to clipboard
swagger_parser: ^0.2.4 copied to clipboard

Generate REST clients and data classes from swagger json file

Swagger Parser #

pub package Style Star on Github Tests

Dart package that generates REST clients and data classes from swagger json file #

Features #

Run command #

To generate boilerplate code, run the generate program inside directory where your pubspec.yaml file is located:

dart run swagger_parser:generate

Add your OpenApi json file configuration to your pubspec.yaml or create a new config file called swagger_parser.yaml. An example of YAML is shown below

Configure package #

dev_dependencies:
  swagger_parser: ^0.2.4

swagger_parser:
  json_path: assets/swagger.json # Required. Sets the json path directory for generated files
  output_directory: generated # Required. Sets output directory for generated files
  language: dart # Optional. Sets the programming language. Current available languages are: dart, kotlin. Default: dart
  squish_clients: true # Optional. Set 'true' to put all clients in one folder. Default: false
  client_postfix: Client # Optional. Set postfix for client folder and Class. Works if there is only a single class or squish is true. Default: Client
  freezed: false # Optional (dart only). Set 'true' to generate data classes using freezed package. Default: false

If you name your configuration file something other than swagger_parser.yaml or pubspec.yaml you will need to specify the name of the YAML file as an argument.

dart run swagger_parser:generate -f <path to your config file>
56
likes
0
pub points
79%
popularity

Publisher

verified publishercarapacik.dev

Generate REST clients and data classes from swagger json file

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args, collection, path, yaml

More

Packages that depend on swagger_parser