swagger_parser
swagger_parser copied to clipboard
Package name for Kotlin classes
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