-
Notifications
You must be signed in to change notification settings - Fork 426
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
Spring-Cloud Codegen Broken due to unknown import import io.swagger.configuration.NotUndefined; #1319
Comments
It shouldn't create issues or errors, if you are still experiencing issues please provide the spec causing the issues along with the generator options used. Please close ticket if your problem is solved |
Thanks, I will check, I would assume it's a bug caused by my spec, that wasn't anticipated. I check the generated code, if I can locate the annotation there. Maybe there's a package name mismatch. |
Ok got it. What in my opinion wasn't anticipated is, I configured generateSupportingFiles to false, since we didn't need them. It creates an ApiKeyRequestInterceptor we don't need, a clientconfiguration we don't need, since we need to adjust it anyways, and also as I've seen now the missing annotation @NotUndified, in the wrong package (it uses the packagepath of what I configured with configPackage. So, this doesn't really work in maven-codegen-maven-plugin this way. It would only work, if i didn't change the configPackage name, and even then, it might cause problems, cause we don't need the supporting files (they might even cause problems currently). Edit: Sadly this is kinda messy at the moment. I also had to enable useBeanValidation, for the annotation to be generated. I would assume useBeanValidation should disable adding the import to the annotation at all. |
@FrostbittenKing thanks for the feedback, and you are right! We are working on that, it would help if you could share the full config you are using |
Yes, I will post this, after I cleaned it up, since it's work related. |
Hi @frantuma , here is the maven plugin build block, cleaned up. There are also probably still one or two workarounds in the config attached, for bugs that occurred in the past (i think the typemappings stuff + dateLibrary legacy, also defaultInterces enabled caused problems with missing imports as far as I remember), but these don't seem to be having an effect on our issue at hand. It would be really nice, if the imports were removed, if useBeanValidation is set to false, and also, that the package paths genertated match the configPackage property, if useBeanValidation was set to true. |
This has been fixed in #1322 and swagger-api/swagger-codegen#12487. @FrostbittenKing please have a go with latest 3.0.64-SNAPSHOT (release will follow in 1-2 days), the issues mentioned should be fixed. |
Thank you!!!, I will try when I get to it. |
Hi, thank you for the fix, it worked without any issues, or any additional configuration. This can be closed for now. |
Hi, since introduction of the annotation NotUndefined in swagger-codegen-generators v1.0.52, spring cloud code generation breaks, due to a new annotation io.swagger.configuration.NotUndefined that doesn't seem to exist anywhere.
Commit: 2835d9d
I can't locate the dependency where this comes from. Not via grep, not google.
I have no idea how this slipped by all tests, and randomly breaks code generators using swagger-codegen-generators.
I checked the source, and for now i can only disable it with legacy in the swagger-codegen-maven-plugin / using a command line flag, when invoking swagger-codegen cli directly.
Whats the point of this annotation, and why can't I find anything about it in any package, where this got introduced.
Google doesn't turn up squats when i try to directly search ' io.swagger.configuration.NotUndefined', there is no dependency with the package path io.swagger.configuration. At least none I could find.
Thanks.
The text was updated successfully, but these errors were encountered: