Skip to content

Commit

Permalink
feat: bigint support
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael M authored Nov 4, 2022
2 parents e200acc + f5964da commit 09f9468
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions packages/ng-openapi-gen/src/lib/utils/open-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ export function tsTypeVal(
return 'Blob';
}

// A simple type
return type === 'integer' ? 'number' : type;
// An integer
if (type === 'integer') {
return schema.format === 'int64' ? 'bigint' : 'number';
}

// Any other type
return type;
}

/** Resolves a reference from its name, such as #/components/schemas/Name, or just Name */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

export interface AuditLog {
date?: string;
id?: number;
id?: bigint;
text?: string;
type: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export enum RefEnum {
ValueA = 'value\'A',
ValueB = 'value\'B',
ValueC = 'value\'C',
_ = ''
_ = '',
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
export enum RefIntEnum {
$100 = 100,
$200 = 200,
$300 = 300
$300 = 300,
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
export enum RefNamedIntEnum {
first = 100,
second = 200,
third = 300
third = 300,
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */

export interface PetstorePetModel {
id: number;
id: bigint;
name: string;
tag?: string;
}

0 comments on commit 09f9468

Please sign in to comment.