Skip to content

[BUG] Kotlin multiplatform requires auth methods #6982

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

Open
6 tasks
Andrewpk opened this issue Jul 18, 2020 · 2 comments
Open
6 tasks

[BUG] Kotlin multiplatform requires auth methods #6982

Andrewpk opened this issue Jul 18, 2020 · 2 comments

Comments

@Andrewpk
Copy link
Contributor

Andrewpk commented Jul 18, 2020

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

When generating a new client with the kotlin generator and the multiplatform library, if your spec has no api endpoints that require any authentication methods, the generated client will have errors and a private authentications property will be generated with lazy instantiation block of:

{
    mapOf()
}
openapi-generator version

4.3.1

OpenAPI declaration file content or url

Works with any declaration that contains zero authorizations: arrays.

Command line used for generation

openapi-generator generate -g kotlin --library multiplatform -o kotlin_client -i test.yaml

Steps to reproduce
  • Grab a valid openapi spec with no authorizations for any endpoints
  • Generate a kotlin multiplatform client
  • Try to build a native library from the generated client code, e.g.: ./gradlew clean jvmJar
Related issues/PRs
Suggest a fix

I submitted a PR to fix the issue. More work regarding the kotlin mutliplatform library needs to be done for sure though: #6983

@auto-labeler
Copy link

auto-labeler bot commented Jul 18, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@chris-hatton
Copy link

chris-hatton commented Nov 26, 2020

Worth being aware of #7353 which, when completed, may supersede the current kotlin-multiplatform support and thereby offer a workaround for this issue.

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

No branches or pull requests

2 participants