swagger-api / swagger-api/swagger-codegen
[GO] Bug when other go tools does not see code generated by swagger-codegen as code generated
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Go code generated by swagger-codegen has a line with the following comment:
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
This comment does not match the pattern for generated code in go:
^// Code generated .* DO NOT EDIT\.$
Described here https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source
Swagger-codegen version
3.0.54
Swagger declaration file content or url
Command line used for generation
swagger-codegen generate -i swagger.yaml -l go
Steps to reproduce
Related issues/PRs
This PR fixes the issue https://github.com/swagger-api/swagger-codegen/pull/12357
Suggest a fix/enhancement
The fix could be to change the line to the following
// Code generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) DO NOT EDIT.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the swagger-codegen generate -i swagger.yaml -l go entry point and inspect the Go template responsible for the generated header; PR #12357 is the related work to review. Done means generated Go output uses the documented Code generated ... DO NOT EDIT. form so other Go tools recognize it as generated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100