We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 13db783 + 8bc6074 commit ce22585Copy full SHA for ce22585
1 file changed
src/utils/schema-utils.js
@@ -19,7 +19,10 @@ export function getTypeInfo(parameter, options = { includeNulls: false, enableEx
19
let format = schema.format || schema.items?.format || '';
20
if (schema.circularReference) {
21
dataType = `{recursive: ${schema.circularReference.name}} `;
22
- } else if (schema.type) {
+ } else if (schema.type || schema.const) {
23
+ if (!schema.type && schema.const) {
24
+ schema.type = 'const';
25
+ }
26
const arraySchema = Array.isArray(schema.type) ? schema.type : (typeof schema.type === 'string' ? schema.type.split('┃') : schema.type);
27
dataType = Array.isArray(arraySchema) ? arraySchema.filter((s) => s !== 'null' || options.includeNulls).join('┃') : schema.type;
28
['string', 'number'].forEach(type => {
0 commit comments