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
  • #10036
Closed
Open
Issue created Jul 25, 2021 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] [Kotlin] Unresolved reference `AnyType`

Created by: IARI

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Several models and *api classes depend on a type named AnyType. (for example an object-type schema with a property where the type is not specified) However, AnyType is not generated as a model.

openapi-generator version

5.2.0

OpenAPI declaration file content or url

I am trying to generate the jira api, using https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json

Generation Details

using the gradle plugin, excerpt from build.gradle.kts:


plugins {
    kotlin("jvm") version "1.5.10"

    id("org.openapi.generator") version "5.2.0"
}

// ...

tasks {
    compileKotlin {
        kotlinOptions.jvmTarget = "1.8"
    }
    // ...

    openApiGenerate {
        generatorName.set("kotlin")
        inputSpec.set(jiraApiSpec.absolutePath)
        outputDir.set(generatedDir)
        apiPackage.set("com.atlassian.jira.rest.api")
        modelPackage.set("com.atlassian.jira.rest.model")
        invokerPackage.set("com.atlassian.jira.rest.client")
        groupId.set("com.atlassian.jira.rest")
        library.set("jvm-okhttp4")
        configOptions.set(
            mapOf(
                "dateLibrary" to "java8"
            )
        )
    }
Steps to reproduce
  1. download the jira api spec from above
  2. make sure that jiraApiSpec is set to the download location
  3. run gradle openApiGenerate
  4. run gradle build on the generated gradle project
Related issues/PRs

Others appear to have had Issues with AnyType with other generators. Some Have been fixed, others are open yet. #7618 Swift (also #7617 (closed)) #9969 C #7458 C# #6332 (closed) Typescript #6668 (closed) PhP

Suggest a fix

I am completely new to OpenAPI. However according to @wing328 in https://github.com/OpenAPITools/openapi-generator/issues/6668#issuecomment-644849020_ it seems to have been added in mid-2020 - so I assume it has simply not been implemented for several generators - kotlin among them - yet.

Assignee
Assign to
Time tracking