Skip to content

Support for file based config. Implementation for #616. #805

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

Merged
merged 19 commits into from
Jun 2, 2015

Conversation

hyeghiazaryan
Copy link
Contributor

Implementation for #616

This adds file based config support: --config @config.json

File format

{
  "classPrefix":"MyProj",
  "sourceFolder":"my_proj_client"
}

hrachya added 16 commits May 26, 2015 15:49
…th default implementation in DefaultCodegen
…ine options

Add all the specified ones to clientOpts properties
Add setters for modelPackage and apiPackage
…rceFolder' command line options for java (and all the derived ones jaxrs, spring-mvc ...)

Add processOpts override to process java  specific options
Move supporting file initialization from constructor to processOpts, since it uses some of the options that are not yet set in the constructor
Add setters
setting options passed in config file if those were allowed by lang specific CodegenConfig
@who
Copy link
Contributor

who commented May 29, 2015

👍

@lakeba
Copy link

lakeba commented May 29, 2015

Can we please merge the pulls from @wing328 in the developer 2.0? I really need it for my production project !!! thank you in advance.

@who
Copy link
Contributor

who commented May 29, 2015

@uniprof This PR thread is not the correct place to ask for that, as it is unrelated to your request. Please ask in the correct place.

@who
Copy link
Contributor

who commented May 29, 2015

@fehguy @olensmar @webron

+1 to merge this PR from @hyeghiazaryan.

@hyeghiazaryan hyeghiazaryan changed the title Develop 2.0 Support for file based config. Implementation for #616. May 29, 2015
@hyeghiazaryan
Copy link
Contributor Author

Example of client output when running config-help command

java -jar swagger-codegen-cli.jar config-help -l objc

CONFIG OPTIONS
    modelPackage
        package for generated models

    apiPackage
        package for generated api classes

    classPrefix
        prefix for generated classes

    sourceFolder
        source folder for generated code

    projectName
        name of the Xcode project in generated Podfile
java -jar swagger-codegen-cli.jar config-help -l java

CONFIG OPTIONS
    modelPackage
        package for generated models

    apiPackage
        package for generated api classes

    invokerPackage
        root package for generated code

    groupId
        groupId in generated pom.xml

    artifactId
        groupId in generated pom.xml

    artifactVersion
        artifact version in generated pom.xml

    sourceFolder
        source folder for generated code

@webron
Copy link
Contributor

webron commented May 29, 2015

@hyeghiazaryan - it's up to @fehguy to merge it, but I would appreciate either a modification to the README.md or an additional file with documentation for this feature (linked from the main README).

@hyeghiazaryan
Copy link
Contributor Author

Valid point @webron, I'll modify the README.md.

* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would better to remove these comments to be consistent with other files in the repo

@@ -0,0 +1,54 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either remove this header or add the Apache 2.0 License header

@olensmar
Copy link
Contributor

olensmar commented Jun 2, 2015

Looks great - I'd love to merge this - please fix the file headers as indicated in the comments first - thank you!

olensmar pushed a commit that referenced this pull request Jun 2, 2015
Support for file based config. Implementation for #616.
@olensmar olensmar merged commit 2662167 into swagger-api:develop_2.0 Jun 2, 2015
@olensmar
Copy link
Contributor

olensmar commented Jun 2, 2015

thank you!

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

Successfully merging this pull request may close these issues.

6 participants