Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package name for Kotlin classes #245

Open
BsBrabi opened this issue Jun 27, 2024 · 0 comments
Open

Package name for Kotlin classes #245

BsBrabi opened this issue Jun 27, 2024 · 0 comments

Comments

@BsBrabi
Copy link

BsBrabi commented Jun 27, 2024

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:

  • PetClient.kt: package com.test.app.rest.pet
  • Pet.kt: package com.test.app.rest.models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant