swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.88k stars 6.03k forks source link

Indicate somewhere the swagger-codegen version that was used #2183

Closed cbornet closed 7 years ago

cbornet commented 8 years ago

It would be handy to have the swagger-codegen version that generated the code somewhere. For instance in the READMEs or in a dedicated file.

wing328 commented 8 years ago

@cbornet yes, agree with you that the swagger-codegen version is useful (e.g. for troubleshooting the SDK)

jimschubert commented 8 years ago

I'd also like to see a dump of the options that were used.

jimschubert commented 7 years ago

Would anyone be opposed to creating output .swagger/VERSION and .swagger/OPTIONS text files for all generators?

wing328 commented 7 years ago

There's an ongoing work to add a mustache tag containing the Swagger Codegen version (e.g. 2.3.0) but there are minor issues that we need to roll back the enhancement: https://github.com/swagger-api/swagger-codegen/pull/5489

Related discussion: https://github.com/swagger-api/swagger-codegen/issues/5376

jimschubert commented 7 years ago

@wing328 cool. It looks like that PR and issue are interested in outputting the version to templates. I opened a PR that outputs the version to .swagger/VERSION. See #5556 and let me know what you think.

cbornet commented 7 years ago

Shouldn't it be .swagger-codegen/VERSION ?

jimschubert commented 7 years ago

@cbornet generally, hidden folders are org-specific and not product-specific... at least in my experience. Do you think .swagger/CODEGEN_VERSION would be better? I don't mind either way.

I could change it to .swagger-codegen/VERSION if you think that's more appropriate.

wing328 commented 7 years ago

@jimschubert I would prefer .swagger-codegen/VERSION so as to do a little bit of growth hacking for Swagger Codegen - developers who consume the API clients or use the server stubs may do a Google search on swagger-codegen after discovering the hidden folder.

wing328 commented 7 years ago

Thanks @jimschubert for the PR, which has been merged into master.

I've renamed .swagger to .swagger-codegen via fd3cae6

jimschubert commented 7 years ago

Thanks. I hadn't seen your comment from yesterday about moving forward with .swagger-codegen.