I am trying to get the components to appear nested together when using OpenAPI 3.0 Java annotations. However, every object that is referenced inside another object are being created as $ref instead of being built out as that field node. How can I get it to nest under without the $ref?
For Example:
public class User{
int id;
String name;
ContactInfo contactInfo;
}
public class ContactInfo{
String email;
String phone;
}
as
components:
schemas:
User:
type: object
properties:
id:
type: integer
name:
type: string
contact_info:
# The value of this property is an object
type: object
properties:
email:
type: string
format: email
phone:
type: string
instead of
components:
schemas:
User:
type: object
properties:
id:
type: integer
name:
type: string
contactInfo: {
$ref: "#/components/schemas/ContactInfo"
}
ContactInfo:
type: object
properties:
email:
type: string
format: email
phone:
type: string