[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
- download the jira api spec from above
- make sure that jiraApiSpec is set to the download location
- run
gradle openApiGenerate
- 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.