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

Is there a way to shorten multiple similar blocks of configuration? #198

Open
Drodevbar opened this issue Apr 15, 2020 · 1 comment
Open

Comments

@Drodevbar
Copy link

Drodevbar commented Apr 15, 2020

Hello,

thank you for your work put into the plugin development.

I would like to ask if there is a way (enabled by this plugin explicitly or maybe by using some Groovy magic) to shorten multiple similar blocks of configuration into one.

Let's say that i have swaggerSources configured like below:

swaggerSources {
    source1 {
        inputFile = file('file1')
        code {
            language = 'spring'
            additionalProperties = [
                    'modelPackage': 'model1'
            ]
        }
    }

    source2 {
        inputFile = file('file2')
        code {
            language = 'spring'
            additionalProperties = [
                    'modelPackage': 'model2'
            ]
        }
    }

    // x - 2 source configurations...
}

As you can see, there are multiple almost identical sources which are varying only in inputFile and modelPackage. Do you think there is a way to shorten it from declaring x almost identical sources into one parametrized?

@K987
Copy link

K987 commented Aug 9, 2021

Hello!

I have a similar issue and couldn't really find any solution provided by the plugin, however you can create a separate configuration for GenerateSwaggerCode tasks:

tasks.withType(GenerateSwaggerCode).configureEach { language = "jaxrs-cxf-client" .... }

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