Amartus / yang2swagger

Yang to swagger generator
Eclipse Public License 1.0
32 stars 21 forks source link

Merge in downstream changes? #1

Closed jdillard closed 6 years ago

jdillard commented 6 years ago

Hi,

I came across UltimateDogg's great work where, among other things, they added in some CLI and maven options that make it easier to get the desired swagger file on the first pass without having to modify it manually later. For example the CLI, and maven version, now have options for:

-api-version string : The current version of your API (default: 1.0)
-format enum        : The output format (options: YAML, JSON) (default: YAML)

-api-version allows swagger to be converted to OpenAPI v3 and -format allows it be output in formats that other tools might have a preference for.

I was curious if you would be interested in either having all of those changes merged into this repo or cherry-picking any applicable changes.

bartoszm commented 6 years ago

Hi @jdillard, Sure that would be useful.

jdillard commented 6 years ago

Thanks for the merge! I ran version 1.1.4 and it seems it isn't picking up the new flags. Still looking into it, but wasn't sure if others were having the same issue:

java -jar /path/to/cli/target/swagger-generator-cli-1.1.4-executable.jar <module_name> -api-version 1.0 -format JSON -yang-dir /usr/src/yang -output /usr/src/yang/<module_name>.json
"-api-version" is not a valid option
 module ...     : List of YANG module names to generate in swagger output
                  (default: <module_name>)
 -output file   : File to generate, containing the output - defaults to stdout
                  (default: )
 -yang-dir path : Directory to search for YANG modules - defaults to current
                  directory. Multiple dirs might be separated by system path
                  separator (default: )

edit: It appears it is working, I was just using the wrong jar file.

bartoszm commented 6 years ago

Thank you guys for the contributions