swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[General] We should add more data to the generated headers

Open jaz-ah opened this issue 10 years ago • 7 comments

Currently a generated header in Swift for example is: // // Foo.swift // // Generated by swagger-codegen // https://github.com/swagger-api/swagger-codegen //

It would be useful to also include: -The date of code generation -The version of swagger used to generate the code -Any other useful information that we can add there?

jaz-ah avatar Jan 28 '16 00:01 jaz-ah

I agree. I think there should be standard header for all generated codes. I'll submit a PR this weekend or early next week if no one else has cycle to work on it.

wing328 avatar Jan 28 '16 14:01 wing328

cool thx.

jaz-ah avatar Jan 28 '16 18:01 jaz-ah

I wanted to provide some perspective as a swagger-codegen user. We find these date based annotations add a lot of noise to our review process when we regenerate clients.

We solved this problem by writing post-processing scripts but I thought it worth mentioning even if our use-case was a minority.

jqr avatar Jan 29 '16 17:01 jqr

@jqr thanks for sharing the requirement with us.

so ideally the generator should skip the file if the newly-generated file and the one in the output directory are the same, right?

wing328 avatar Jan 30 '16 06:01 wing328

What about putting the date in one file only (e..g pom.xml for Java, Gemfile for Ruby, etc)?

wing328 avatar Jan 30 '16 06:01 wing328

Submitted https://github.com/swagger-api/swagger-codegen/pull/2008 for Ruby mustache templates. Let me know if you've any feedback.

Will gradually update mustache templates for other languages with similar change.

wing328 avatar Jan 31 '16 09:01 wing328

Closed via https://github.com/swagger-api/swagger-codegen/issues/2963

wing328 avatar Jul 09 '16 06:07 wing328