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

[BUG] [Kotlin] Unresolved reference AnyType #10036

Closed
4 of 6 tasks
IARI opened this issue Jul 25, 2021 · 2 comments · Fixed by #10070
Closed
4 of 6 tasks

[BUG] [Kotlin] Unresolved reference AnyType #10036

IARI opened this issue Jul 25, 2021 · 2 comments · Fixed by #10070

Comments

@IARI
Copy link

IARI commented Jul 25, 2021

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)
#9969 C
#7458 C#
#6332 Typescript
#6668 PhP

Suggest a fix

I am completely new to OpenAPI.
However according to @wing328 in #6668 (comment)_ 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.

@IARI IARI changed the title [BUG] [Kotlin] [BUG] [Kotlin] Unresolved reference AnyType Jul 25, 2021
@wing328
Copy link
Member

wing328 commented Aug 1, 2021

@IARI I've filed #10070 to fix the issue.

@wing328
Copy link
Member

wing328 commented Aug 1, 2021

FYI. I've filed #10071 to fix other issues when using https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json to generate the Kotlin client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants