express-jsdoc-swagger icon indicating copy to clipboard operation
express-jsdoc-swagger copied to clipboard

[BUG] Nested object schema definitions don't work

Open chladnefazole opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug Nested object schema definitions don't work.

To Reproduce For example, I have interface:

export interface Example {
    id?: number,
    someObj: {
        prop1: number,
        prop2: number,
    }
}

I represent it like this:

/**
 * Object containing some stuff
 * @typedef {object} Example
 * @property {number} id - An ID
 * @property {object} someObj - Object containing properties
 * @property {number} someObj.prop1 - Property 1
 * @property {number} someObj.prop2 - Property 2
 */

Expected behavior example.someObj should show as an OBJECT containing some number properties.

Instead I get: image

ie. example.someObj is shown to have type number, and its description is not the one I set for it (Object containing properties), but instead it shows the description of someObj's last property (Property 2)

Desktop (please complete the following information):

  • Latest version

chladnefazole avatar Jun 24 '24 11:06 chladnefazole