Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5165
Closed
Open
Issue created Jan 30, 2020 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] [kotlin-spring] interfaceOnly doesn't work as expected

Created by: mariusstokseth

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Using the openapi-gradle plugin i setup a task to generate code for the Petstore example [YAML] (https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml). I have created the following task:

task buildKotlinClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
    generatorName = "kotlin-spring"
    inputSpec = "$rootDir/pet.yaml".toString()
    outputDir = "$rootDir/generated-sources/".toString()
    apiPackage = "sandbox.api"
    modelPackage = "sandbox.model"
    configOptions = [
            dateLibrary: "java8",
            swaggerAnnotations: "true",
            interfaceOnly: "true",
    ]
    systemProperties = [
            modelDocs: "false",
            generateSupportingFiles: "false",
    ]
}

From what I understand only the PetAPI and the objects Error and Pet should be generated. Instead the task also generates Application.kt, build.gradle.kts, pom.xml, README.m, settings.gradle and application.yaml

openapi-generator version 4.2.2
gradle version 6.1.1
OpenAPI declaration file content or url

URL: https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml

Steps to reproduce
  1. Download Petstore Example YAML
  2. Run code generation task using the Gradle Plugin
  3. Navigate to the genearted-sources folder
Assignee
Assign to
Time tracking