Description of the problem/issue
With PR #5034 the default behavior of how a Java Object for OAS 3.1 is resolved was changed from being an empty type definition to always being type object. This can cause incorrect schema generation, since Object is not necessary a JSON-object (e.g., "string" is a valid Java Object, but not a valid JSON-object).
The interpretation of a Java Object should instead be tied to explicit-object-schema, which was introduced and described in #4868. It also correctly states that this behavior should be an explicit opt-in (and also highlights that the current behavior of 3.0 is incorrect, but that it is kept/not corrected due to backwards compatibility concerns).
Affected Version
2.2.45
Earliest version the bug appears in (if known):
2.2.44
Steps to Reproduce
Have a class that have a property with type Object. E.g.
private static class PojoUsingObjectField {
private Object myField;
public Object getMyField() {
return myField;
}
public void setMyField(Object myField) {
this.myField = myField;
}
}
Expected Behavior
A Java Object should be resolved to an empty type.
Actual Behavior
A Java Object is resolved to type object.
Logs / Stack Traces
Additional Context
Checklist
Description of the problem/issue
With PR #5034 the default behavior of how a Java
Objectfor OAS 3.1 is resolved was changed from being an empty type definition to always being typeobject. This can cause incorrect schema generation, sinceObjectis not necessary a JSON-object (e.g., "string" is a valid JavaObject, but not a valid JSON-object).The interpretation of a Java
Objectshould instead be tied toexplicit-object-schema, which was introduced and described in #4868. It also correctly states that this behavior should be an explicit opt-in (and also highlights that the current behavior of 3.0 is incorrect, but that it is kept/not corrected due to backwards compatibility concerns).Affected Version
2.2.45
Earliest version the bug appears in (if known):
2.2.44
Steps to Reproduce
Have a class that have a property with type
Object. E.g.Expected Behavior
A Java Object should be resolved to an empty type.
Actual Behavior
A Java Object is resolved to type
object.Logs / Stack Traces
Additional Context
Checklist