Giter Site home page Giter Site logo

Comments (6)

steam0 avatar steam0 commented on September 18, 2024 2

Yes, I did but not with this plugin.

Take a look at this excellent guide: https://www.jcore.com/2017/05/22/automatically-generating-api-using-swagger-and-gradle/

I ended up creating a partly generic gradle task based on that example. I am on vacation now (answering from my phobe), but I think this is all you need.

https://gist.github.com/steam0/4fa11ad0660d33192ec01cd84050f226

from swagger-codegen-gradle-plugin.

steam0 avatar steam0 commented on September 18, 2024

Example:

I want to run both these configurations in the same swagger generation run.

Api1

swagger {
inputSpec = 'http://localhost:8081/v2/api-docs'

outputDir = 'build/generated-sources/apifromserver1'
lang = 'spring'

addDynamicProperty 'sourceFolder', ''

additionalProperties = [
        'modelPackage': 'com.github.apifromserver1',
]

systemProperties = [
        'models': ''
]
}

Api2

swagger {
inputSpec = 'http://localhost:8082/v2/api-docs'

outputDir = 'build/generated-sources/server2name
lang = 'spring'

addDynamicProperty 'sourceFolder', ''

additionalProperties = [
        'modelPackage': 'com.github.server2name,
]

systemProperties = [
        'models': ''
]
}

from swagger-codegen-gradle-plugin.

holmbech avatar holmbech commented on September 18, 2024

Hi,

I would like the same functionality.

steam0 did you come with a solution?

from swagger-codegen-gradle-plugin.

holmbech avatar holmbech commented on September 18, 2024

Awesome! Just what I was looking after.

Thanks a lot! :-D

from swagger-codegen-gradle-plugin.

thebignet avatar thebignet commented on September 18, 2024

This is great ! It would be even more flexible than a plugin as it would allow changing swagger-codegen version dynamically. I'll keep it in mind !

from swagger-codegen-gradle-plugin.

thebignet avatar thebignet commented on September 18, 2024

I've updated README and example with this. Fixes a lot of issues people were having. Thanks for the tip

from swagger-codegen-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.