You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add some post generation functionality after a generator has created all the files.
Specifically, I'd like to call gofmt for the files being produced by the Go client generator. I have a working implementation but I'm currently overriding postProcessSupportingFileData with the following:
I've filed #929 to add postProcessFile and update Go generator to use it with gofmt -w. The results look good so far. Please have a look when you've time.
Description
I'd like to add some post generation functionality after a generator has created all the files.
Specifically, I'd like to call
gofmt
for the files being produced by the Go client generator. I have a working implementation but I'm currently overridingpostProcessSupportingFileData
with the following:When I do this,
gofmt
gets called after the models and APIs but before the supporting files includingclient.go
andREADME.md
It seems a new hook may be needed to execute some code in
DefaultGenerator.generate
aftergenerateSupportingFiles
andprocessOpenAPI
.This may also be useful for the "Additional tools" section of the roadmap:
openapi-generator version
3.1.0 / master
OpenAPI declaration file content or url
n/a
Command line used for generation
n/a
Steps to reproduce
n/a
Related issues/PRs
https://stackoverflow.com/questions/51215890/openapi-generator-swagger-codegen-how-to-add-a-function-after-all-files-have
Suggest a fix/enhancement
Add a hook like
postProcessFinalize
that runs after supporting files are run.The text was updated successfully, but these errors were encountered: