Skip to content

Commit

Permalink
fix: using $ref for enums on parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-gregoire committed Nov 30, 2023
1 parent ce4a386 commit e373243
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/services/schema-object-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export class SchemaObjectFactory {
undefined
) as [Type<any>, boolean];
}
if (!isBodyParameter(param) && param.enumName) {
return this.createEnumParam(param, schemas);
}
if (this.isPrimitiveType(param.type)) {
return param;
}
Expand Down Expand Up @@ -89,14 +92,10 @@ export class SchemaObjectFactory {
return flatten(parameterObjects);
}

createQueryOrParamSchema(
private createQueryOrParamSchema(
param: ParamWithTypeMetadata,
schemas: Record<string, SchemaObject>
) {
if (param.enumName) {
return this.createEnumParam(param, schemas);
}

if (isDateCtor(param.type as Function)) {
return {
format: 'date-time',
Expand Down

0 comments on commit e373243

Please sign in to comment.