Carapacik / swagger_parser

Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
https://pub.dev/packages/swagger_parser
MIT License
87 stars 33 forks source link

Package name for Kotlin classes #245

Open BsBrabi opened 1 week ago

BsBrabi commented 1 week ago

Use case

When generating Kotlin classes into a specific directory in my project, the package declaration should be present in all generated clients and models with the correct package.

Proposal

New parameter package to specify the package in which the files are located.

Swagger parser config:

swagger_parser:
  schema_url: https://petstore.swagger.io/v2/swagger.json
  output_directory: ../src/main/java/com/test/app/rest
  language: kotlin
  package: com.test.app.rest

All generated files contain package declaration in the beginning of the file, for example: