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

Hi, would you please add how to use this in ktor project ? #1

Closed
ganeshmahajan1985 opened this issue Oct 9, 2019 · 4 comments
Closed

Comments

@ganeshmahajan1985
Copy link

Hi this is nice, I am new to ktor.
would you please add how to use this in ktor project ?
like what to include in gradle.build file etc. step by step ?

@Wicpar
Copy link
Collaborator

Wicpar commented Oct 9, 2019

Hi,
You can use it as submodule:

install the submodule:

git submodule add https://github.com/papsign/Ktor-OpenAPI-Generator.git openapigen

declare the folder in settings.gradle

...
include 'openapigen'

declare the dependency in the main build.gradle

dependencies {
    compile project(":openapigen")
    ...
}

@ganeshmahajan1985
Copy link
Author

Hi @Wicpar ,
I tried this but on building the project it is giving error
Unresolved references:bind
On like numbber 17 at OpenAPIGen.kt file
import javax.xml.bind.JAXBElement

@ganeshmahajan1985
Copy link
Author

Hi @Wicpar ,

There are two changes i have made in build.gradle file and it is working for me now.

  1. Updated kotlin dependency using "apply plugin: 'kotlin'"
  2. jvmTarget explicitly to 1.8
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

It is woking as expected now. Thanks

@Wicpar
Copy link
Collaborator

Wicpar commented Oct 14, 2019

Hi @Wicpar ,
I tried this but on building the project it is giving error
Unresolved references:bind
On like numbber 17 at OpenAPIGen.kt file
import javax.xml.bind.JAXBElement

the import was unused, i deleted it,
can you see if you still have to explicitly set the jvm version?

Wicpar pushed a commit that referenced this issue Jul 22, 2020
kkalisz added a commit to kkalisz/Ktor-OpenAPI-Generator that referenced this issue Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants