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

Generating multiple APIs on the domain module #5

Closed
michaelbrainvu opened this issue Feb 20, 2020 · 4 comments
Closed

Generating multiple APIs on the domain module #5

michaelbrainvu opened this issue Feb 20, 2020 · 4 comments
Labels
question Further information is requested

Comments

@michaelbrainvu
Copy link

I tried to generating another api on the domain module by adding another openApiGenerate section to the build script but it seems that the generator generates only the last API entry. Is there a way generate several APIs? Do I need to create a separate domain module for each API?

@Alex009
Copy link
Member

Alex009 commented Feb 21, 2020

try setup by this guide https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin#generate-multiple-sources

but necessary is generatorName.set("kotlin-ktor-client")

@Alex009 Alex009 added the question Further information is requested label Feb 21, 2020
@michaelbrainvu
Copy link
Author

Trying to do something like:
tasks.register<org.openapitools.generator.gradle.plugin.tasks.GenerateTask>("generateOpenApi") {
inputSpec.set(file("src/openapi.yml").path)
apiPackage.set("dev.icerock.moko.network.generated.apis")
generatorName.set("kotlin-ktor-client")
}

But always get an error: language/generatorName must be specified
Not sure what I am doing wrong
In any case, looking at the moko network plugin code, it seems that the plugin deletes all output generated code before generating new code so I do not see how I can generate several apis on one module. It seems that each API must be located on its own module

@Alex009
Copy link
Member

Alex009 commented Feb 27, 2020

I agree, at the moment it is not possible to make several APIs in one module.

You can add issue to https://github.com/icerockdev/moko-network with suggestion of support multiple API

@Alex009
Copy link
Member

Alex009 commented Mar 11, 2021

in moko-network 0.9.0 available multiple api generation - https://github.com/icerockdev/moko-network/releases/tag/release%2F0.9.0

@Alex009 Alex009 closed this as completed Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants