-
-
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
[REQ] reduce log level of "allOf with multiple schemas defined..." warning message #11841
Comments
The problem with this warning is not that it should be info/debug, but that it's entirely wrong and shouldn't be there. allOf is supposed to be used with multiple schemas by design, and this warning is saying the opposite. So this is a bug |
This warning is printed when the name for the composite schema of the allOf-Type is determined, regardless of whether it is later used for generating a class: Lines 2102 to 2116 in de149fc
The warning can currently be suppressed by defining Instead of printing out the warning I would suggest joining all names of the |
I am getting this warning when I generate code from the schema that was generated based on the following Java code and annotations: import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "A popular feline pet")
public class Cat extends Pet { } Which results in the following API description: {
"Cat": {
"type": "object",
"description": "A popular feline pet",
"allOf": [
{
"$ref": "#/components/schemas/Pet"
},
{
"type": "object",
"properties": {
"specificCatProperty": {
"type": "string",
"description": "A specific Cat property"
}
}
}
]
}
} If there is a way to explicitly state the name of the schema, it could be hinted in the warning. And if I am just using the annotation incorrectly here, please let me know. |
@RemekGdansk I've been running into this as well, and just stumbled on this thread. I don't have an answer for you, but a question: In my generated Java code, that comes from this snippet of my spec:
I end up with 3 different Java files... one for the parent class ( |
@aaron-613 Yes, in my case I also get 3 classes:
So, the same situation as yours. In my case, when I use the superclass as a generic type in some collection in another class - an even different class is additionally generated and used instead of the expected superclass public class Owner {
public String name;
public List<OwnerPetsInner> pets;
} This -Inner suffixed class contains fields of the superclass Thus, I am wondering if this is the right way to use the tool or not. |
As I understand it the warning only says that the name is determined using only the first schema. If so, the message is just simply wrong and should be something like: |
thanks for the feedback. already fixed in the latest stable version v7.1.0 |
Is your feature request related to a problem? Please describe.
When i currently run the openapi generator in our project, we get a ton of warning messages like:
Build warnings should be reserved for things which are potentially problems that i should think of fixing. From what i can tell, this message pertains to no real problem, and there is nothing i can do to remove the message. To me, this message seems like it should be at best an info message (if not debug). In general, a build should be silent unless there is something meaningful to say, and this message just doesn't seem meaningful
Describe the solution you'd like
Lower the log level of this message to info or debug.
Describe alternatives you've considered
As far as i can tell, there is nothing i can do on my end to fix the problem. if there is a change i can make, i'd love to know what that is.
Additional context
The text was updated successfully, but these errors were encountered: