Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Golang][client] delete sample output dir before rebuild #477

Conversation

grokify
Copy link
Member

@grokify grokify commented Jul 5, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.1.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@antihax
@bvwells

Description of the PR

This deletes the sample Go client output dir samples/client/petstore/go/go-petstore before rebuilding the sample with bin/go-petstore.sh.

Benefits:

  1. Improves confidence in tests because they are run against a clean build without extra files
  2. Keeps sample output dir clean and up to date since the output always reflects the current generator
  3. Simplifies the process for contributors since there's no need to decide whether no longer generated files are important or not

Of note, this PR currently results in the deletion of the Swagger 2.0 spec at:

samples/client/petstore/go/go-petstore/api/swagger.yaml

The 3.0.1 OpenAPI spec remains at:

samples/client/petstore/go/go-petstore/api/openapi.yaml

If we want to keep the Swagger 2.0 spec, it seems like may be worth looking into the postProcessSupportingFileData in AbstractGoCodegen.java and related methods in DefaultGenerator.java.

@wing328
Copy link
Member

wing328 commented Jul 5, 2018

I agree with purging the sample folder given that the test cases are not in that folder.

Shall we do the same in ./bin/go-petstore-withxml.sh?

@grokify
Copy link
Member Author

grokify commented Jul 5, 2018

Good idea.

I've updated ./bin/go-petstore-withxml.sh as well.

I also ran the integration test by temporarily moving go-petstore-withXml to go-petstore locally (and back). It works as expected.

@wing328 wing328 merged commit 869b17f into OpenAPITools:master Jul 6, 2018
jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request Jul 7, 2018
* master: (116 commits)
  3.1.0 release (OpenAPITools#486)
  Fix broken link to openapi generator plugin README (OpenAPITools#484)
  show warning message for nodejs server only (OpenAPITools#481)
  Add grokify to Go technical committee (OpenAPITools#479)
  [Slim] Improve codebase decouple (OpenAPITools#438)
  Ensure typescript samples are up to date (OpenAPITools#444)
  Update README.md
  [Golang][client] delete sample output dir before rebuild (OpenAPITools#477)
  update petstore samples (OpenAPITools#478)
  Revert "Improve Docker Tags (OpenAPITools#390)"
  update go client test dependencies (OpenAPITools#468)
  [Golang][client] fix for schema definition name `file` (OpenAPITools#433)
  Fix '.travis' file (syntax)
  make LICENSE GitHub display compatible (OpenAPITools#467)
  Improve Docker Tags (OpenAPITools#390)
  [Golang][client] fix file suffix for _test.go (OpenAPITools#449)
  Remove copy section (OpenAPITools#463)
  Add link to presentation (OpenAPITools#465)
  Use postProcessOperationsWithModels(Map, List) (OpenAPITools#431)
  [C] Adding petstore sample written in C (OpenAPITools#306)
  ...
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…s#477)

* delete Go client sample output dir before rebuild

* purge go-petstore-withXml samples output dir before build

* update samples

* fix go-petstore-withxml.sh echo path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants