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

The micronaut-openapi-plugin can't be configured to generate only apis or only models #1055

Open
msupic opened this issue Nov 21, 2024 · 1 comment

Comments

@msupic
Copy link
Contributor

msupic commented Nov 21, 2024

Issue description

There are cases when the same model classes can be used with different api classes (reactive vs. sync) so it would be useful to have options in the plugin to generate only apis or only models

@altro3
Copy link
Contributor

altro3 commented Nov 24, 2024

@msupic You already an do it. As you see micronaut plugin creates 2 different tasks:
{18FB4B21-E04C-4CA0-BA5F-A9E19B2945F2}

By default both tasks automatically included to you build proces, but you can exculde one of them with gradle abilities.

Use any of them:

  1. Add -x generateServerOpenApiApis like this: gradle build -x generateServerOpenApiApis

  2. Add this line to your build.gradle file:

project.gradle.startParameter.excludedTaskNames.add("generateServerOpenApiApis")
  1. Disable it by name
tasks.named("generateServerOpenApiApis") {
    it.enabled = false
}

Read more information here: https://docs.gradle.org/current/userguide/controlling_task_execution.html#sec:skipping_tasks

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