fix: fix type generator for tuples
This commit is contained in:
@@ -493,7 +493,7 @@ class ReferenceValueParser {
|
||||
/**
|
||||
* Convert a schema to TypeScript type string
|
||||
*/
|
||||
function schemaToTypeString(schema: Schema, resourceNames?: Map<string, string>): string {
|
||||
export function schemaToTypeString(schema: Schema, resourceNames?: Map<string, string>): string {
|
||||
switch (schema.type) {
|
||||
case 'string':
|
||||
return 'string';
|
||||
@@ -519,7 +519,7 @@ function schemaToTypeString(schema: Schema, resourceNames?: Map<string, string>)
|
||||
const typeStr = schemaToTypeString(el.schema, resourceNames);
|
||||
return el.name ? `${el.name}: ${typeStr}` : typeStr;
|
||||
});
|
||||
return `[${tupleElements.join(', ')}]`;
|
||||
return `[${tupleElements.join(', ')}][]`;
|
||||
}
|
||||
// Wrap union types in parentheses to maintain correct precedence
|
||||
const elementType = schemaToTypeString(schema.element, resourceNames);
|
||||
|
||||
Reference in New Issue
Block a user