dart_openapi_model_gen 0.1.7 copy "dart_openapi_model_gen: ^0.1.7" to clipboard
dart_openapi_model_gen: ^0.1.7 copied to clipboard

Generator for typed models of Swagger definitions and Supabase databases

dart-openapi-model-gen #

CLI to generate Dart models of OpenAPI Swagger definitions. It was specifically built to support Supabase generation as the Supabase CLI is lacking these at the moment.

These models can then be used in your project to do type-safe queries to the database.

Use in your repository #

flutter pub add --dev dart_openapi_model_gen
dart run dart_openapi_model_gen -o lib/models/gen -i <your-swagger-url>

Example #

You can run this to try it on any swagger file.

dart run bin/dart_openapi_model_gen.dart -i https://petstore.swagger.io/v2/swagger.json

For Supabase specifically, you would use this:

dart run bin/main.dart -i https://<your-project-id>.supabase.co/rest/v1/?apikey=<your-anon-key>

Roadmap #

  • Add support for generating enums
1
likes
140
points
94
downloads

Publisher

unverified uploader

Weekly Downloads

Generator for typed models of Swagger definitions and Supabase databases

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

args, http

More

Packages that depend on dart_openapi_model_gen