I want to generate an API file using nestjs/swagger, where one of the properties is an object. In the result under the components/schemas section I see all schemas I created properly, but under the "paths" section I see that the nested properties are extracted and flattened. i.e instead of this one entry
...
"optional": true,
"schema": { "$ref": "#/components/schemas/MySchema" }
I get entries for each of the properties in MySchema (and in the same level with other entries from the parent schema. so really not good).
Anyway, "MySchema" is generated properly in components/schemas, it's just not automatically referenced to in "paths" section. Enums, primitives etc. are automatically referenced, so I guess I just need some adjustments. what do I need to do?