-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[Go] Client Models using AllOf, OneOf, or AnyOf Correctly Include time
and os
imports
#14057
Conversation
…rectly, so doing an `allOf` that referenced a model containing a `time.Time` object would not import `time`. Swap around the logic to instead remove the models that are not embedded but instead referenced via `oneOf` and `anyOf`.
…lting code so any `time` or `os` imports need to be included.
README.md
Outdated
@@ -1,1214 +1,322 @@ | |||
<h1 align="center">OpenAPI Generator</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icubbon thanks for the PR. Why deleted the project's README ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not intended. I will resolve conflicts and re-run generate
to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wing328 The ci/circleci: node1
tests are failing with the below message. Is this a flaky test framework setup issue?
Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.0.0:repackage failed: Unable to load the mojo 'repackage' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:3.0.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springframework/boot/maven/RepackageMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Hello! We are running into this issue as well. Will this PR be merged soon? 🙂 Let me know if I can help with anything. |
Gonna try a new PR without the updated example to see if that will pass CI |
Why closed? I have a problem that |
Addresses #13959
Currently, if a Model is an
allOf
thetime
andos
imports are not correctly added to the generated file. This was introduced recently with a fix to not include those imports when the model is acomposedSchema
#13833. The logic in that fix was just slightly off as anallOf
should be treated the same as a standard model.If a model is an
AllOf
or does not have any composed schemas at all, the sub-models are in-lined defined in the struct. In this case, the standard logic of including thetime
andos
imports apply.If a model is a
OneOf
orAnyOf
, the sub-models are included as pointers to the defined model. In this case, do not include those items in the logic of includingtime
andos
imports.Added an example to samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml that covers the missing case.
PR checklist
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.
master
(6.3.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)@antihax @grokify @kemokemo @jirikuncar @ph4r5h4d @wing328