Skip to content

make it possible to place models in a different package to prevent circular package references for go-server #9089

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ben-sab
Copy link

@ben-sab ben-sab commented Mar 25, 2021

the changes have been tested with a few projects including the pet-store project:
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate --input-spec https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml --model-package models/ --generator-name go-server --output generated

related issues:

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
    @antihax @grokify @kemokemo @jirikuncar

@wing328
Copy link
Member

wing328 commented Mar 26, 2021

Does go client generator have similar issues?

@ben-sab
Copy link
Author

ben-sab commented Mar 26, 2021

@wing328 I haven't actually tested the generated client properly yet, but yes after generating the client code I can see that the --model-package flag isn't taken into account. I can make a separate PR for that if this gets approved.

@wtrocki
Copy link
Contributor

wtrocki commented May 17, 2021

Small rebase is needed. I'm not maintainer but I have tested this change on client side already.
Without this change using some complex openapis fails

@ben-sab ben-sab force-pushed the go-server-placing-models-in-separate-dir branch from 3ac7331 to 4d902cb Compare June 17, 2021 17:51
@wtrocki
Copy link
Contributor

wtrocki commented Jun 17, 2021

Amazing changes. Crossing fingers for this to land soon. It will be game changer for golang ecosystem to have this done

@ben-sab ben-sab force-pushed the go-server-placing-models-in-separate-dir branch 2 times, most recently from 1edbe33 to 451e708 Compare June 17, 2021 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants