https://kotlinlang.org logo
Join SlackCommunities
Powered by
# swagger-gradle-codegen
  • g

    gammax

    02/17/2020, 3:54 PM
    yeah we should do something similar to
    ./gradlew :apollo-gradle-plugin:publishPlugin -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET
    👍 1
  • g

    gammax

    02/18/2020, 3:08 PM
    Just released
    1.4.0
    btw 🙂
    🚀 1
  • g

    gammax

    02/19/2020, 8:54 PM
    Tweeted this: https://twitter.com/cortinico/status/1230234104718856197
    🎉 1
  • g

    gammax

    02/19/2020, 8:54 PM
    Should we merge your change @mbonnin?
    m
    • 2
    • 5
  • g

    gammax

    02/19/2020, 8:54 PM
    Also maybe we can have a ROADMAP file?
    m
    • 2
    • 1
  • g

    gammax

    02/20/2020, 11:33 AM
    Hey @mbonnin, quick question related to Composite build that I’m not able to answer myself: Looks like that if I call
    ./gradlew check
    from the root project, the
    check
    tasks in the imported build are not executed right 🤔 That feels weird to me. Like the only way so far to achieve that is to
    ./gradlew check --project-dir gradle-plugin
    right? Or have I missed something?
  • m

    mbonnin

    02/20/2020, 11:34 AM
    That's correct
  • m

    mbonnin

    02/20/2020, 11:35 AM
    We could add a dependency in the root project if we wanted to: https://docs.gradle.org/current/userguide/composite_builds.html#included_build_task_dependencies
  • m

    mbonnin

    02/20/2020, 11:36 AM
    Copy code
    There is not (yet) any means to directly execute a task from an included build via the command line. Included build tasks are automatically executed in order to generate required dependency artifacts, or the including build can declare a dependency on a task from an included build.
    (a few lines above)
  • g

    gammax

    02/20/2020, 11:37 AM
    yup got it. I wish support for composite build would be better 😞
  • m

    Marcelo

    03/23/2020, 2:16 PM
    Hello!!! How Can I do the inverse , generate swagger spec from my legacy code in ktor ?
    g
    • 2
    • 3
  • f

    Friedger

    06/09/2020, 4:25 PM
    I am looking into using the plugin for a multiplatform project. Using kotlinx.serializtion would be good. Is there any work going on on that?
  • g

    gammax

    06/09/2020, 4:32 PM
    Hi @Friedger, nope there is nothing at the moment on kotlinx.serialization. But we’re happy to discuss supporting it. It shouldn’t be a major deal other than adding another template variation and providing the custom serializer.
  • g

    gammax

    06/09/2020, 4:33 PM
    Also @macisamuele is working on adding polymorphism soon or later. That is going to be a blocker maybe, as it’s shaped to work for Moshi only IIRC 🤔
  • f

    Friedger

    06/09/2020, 4:47 PM
    @gammax I'll have a look at the code
    👍 1
  • f

    Friedger

    06/09/2020, 4:50 PM
    Hm, templates? Where should I look first?
  • g

    gammax

    06/09/2020, 4:53 PM
    So we currently support two types of variants:
    kotlin
    and `kotlin-coroutines`: https://github.com/Yelp/swagger-gradle-codegen#supported-platforms
  • g

    gammax

    06/09/2020, 4:53 PM
    They both rely on Moshi for serialization
  • g

    gammax

    06/09/2020, 4:54 PM
    Templates are in this folder: https://github.com/Yelp/swagger-gradle-codegen/tree/master/gradle-plugin/plugin/src/main/resources/kotlin
  • g

    gammax

    06/09/2020, 4:54 PM
    To give you an example, this line contains a Moshi specific
    @JsonClass
    annotation: https://github.com/Yelp/swagger-gradle-codegen/blob/b392529340277cafc958927dc2f8053e67effc95/gradle-plugin/plugin/src/main/resources/kotlin/data_class.mustache#L7
  • f

    Friedger

    06/09/2020, 4:57 PM
    I see, thank you for the pointers. I'll have a look what needs to be changed.
  • m

    macisamuele

    06/09/2020, 4:58 PM
    @Friedger as @gammax mentioned I’m working on adding polymorphism support into codegen and it’s kinda true that it is partially bound to moshi … but once the whole logic is ready I don’t think it will be very hard to be integrated for other platforms as well 😉
  • f

    Friedger

    06/10/2020, 8:40 PM
    I looked a bit into the code, here is what I found could work with kotlinx.serialization: https://github.com/Yelp/swagger-gradle-codegen/pull/136 I understand that this work is not finished before the polymorphism logic is ready.
    g
    • 2
    • 10
  • f

    Friedger

    06/10/2020, 9:17 PM
    The next could be using ktor client instead of okhttp
  • s

    Stew Boling

    10/26/2020, 7:29 PM
    Has anyone found a workaround for this issue? https://github.com/Yelp/swagger-gradle-codegen/issues/109
    g
    • 2
    • 4
  • g

    Gregory

    01/14/2021, 8:33 PM
    holla my friends
    g
    • 2
    • 6
  • d

    Doug McCluer

    02/23/2021, 4:03 PM
    Hi! My generated android code seems to be using threeten.bp for date/time classes, although my project is using desugaring to provide java.time. Can I configure the plugin to use the java.time classes?
    g
    • 2
    • 7
  • p

    Paul Dhaliwal

    07/20/2021, 2:11 AM
    Are the Moustache Lambdas missing from this plugin? Any generator extending DefaultGenerator are supposed to have them, yet they don’t appear to have any effect in the moustache files https://github.com/OpenAPITools/openapi-generator/blob/master/docs/templating.md#mustache-lambdas
    g
    • 2
    • 6
  • a

    Andreas Stütz

    06/30/2022, 9:39 AM
    Hey everyone! Are there any updates on the java.time vs threeten topic? From what I saw, this PR has been merged in June 2020 but the latest version of the plugin (1.4.1) is still from February 2020? Also I tried using the command line flags like it's shown inside the readme but it's not working for me:
    Copy code
    ./gradlew generateSwagger --inputFile=./specs.json
    is failing with
    Copy code
    Option 'inputFile' cannot be cast to type 'java.io.File' in class 'com.yelp.codegen.plugin.GenerateTask'.
    g
    • 2
    • 4
  • s

    siyangye

    01/11/2023, 11:53 PM
    wondering when the next release is going to be? It's been almost 3 yrs since the last release
    nod 1
    g
    • 2
    • 1