express-jsdoc-swagger
express-jsdoc-swagger copied to clipboard
Non-Object Components for Enums
The types of the components are always assumed to be object. Generally, enums are allowed to be components and they can have integer or string types.
Example enum component:
"SomeType":{"title":"SomeType","enum":["TYPE_1","TYPE_2","TYPE_3"],"type":"string","description":"An enumeration."}
Assumption is made here in transforms/components/index.js
(line 82 -> type:'object'
)
return {
[typedef.name]: {
...combineSchema(elements),
description: schema.description,
...(requiredProperties.length ? {
required: formatRequiredProperties(requiredProperties),
} : {}),
type: 'object',
properties: formatProperties(propertyValues, options),
},
};
Would be great if @typedef {string} creates a string type