openapi-typescript-codegen
Advanced tools
Comparing version
{ | ||
"name": "openapi-typescript-codegen", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification.", | ||
@@ -5,0 +5,0 @@ "author": "Ferdi Koomen", |
@@ -11,8 +11,5 @@ 'use strict'; | ||
Dictionary.definition = { | ||
type: 'Dictionary', | ||
item: { | ||
type: 'any', | ||
}, | ||
type: 'Dictionary' | ||
}; | ||
})(Dictionary || (Dictionary = {})); |
@@ -6,5 +6,5 @@ /* istanbul ignore file */ | ||
import { Dictionary } from "../models/Dictionary"; | ||
import { Dictionary } from '../models/Dictionary'; | ||
type FieldDefinition = { | ||
export type FieldDefinition = { | ||
readonly type?: string; | ||
@@ -30,2 +30,14 @@ readonly isReadOnly?: boolean; | ||
type ArrayDefinition<T> = FieldDefinition & { | ||
readonly item: Definition<T>; | ||
} | ||
type DictionaryDefinition<T> = FieldDefinition & { | ||
readonly item: Definition<T>; | ||
} | ||
type ObjectDefinition<T> = FieldDefinition & { | ||
readonly [K in keyof T]: Definition<T[K]>; | ||
} | ||
export type Definition<T> = | ||
@@ -37,8 +49,5 @@ T extends string ? FieldDefinition : | ||
T extends Blob ? FieldDefinition : | ||
T extends Array<infer U> ? FieldDefinition : | ||
T extends Dictionary<infer U> ? FieldDefinition : | ||
T extends Object ? FieldDefinition & { | ||
readonly properties: { | ||
readonly [K in keyof T]: Definition<T[K]>; | ||
}; | ||
} : FieldDefinition | ||
T extends Array<infer U> ? ArrayDefinition<U> : | ||
T extends Dictionary<infer U> ? DictionaryDefinition<U> : | ||
T extends Object ? ObjectDefinition<T> : | ||
FieldDefinition |
@@ -6,11 +6,3 @@ /* istanbul ignore file */ | ||
import { Definition } from '../core/Definition'; | ||
export interface Dictionary<T> { | ||
/** | ||
* @internal | ||
*/ | ||
readonly __type: T; | ||
export type Dictionary<T> = { | ||
[key: string]: T; | ||
@@ -21,9 +13,6 @@ } | ||
export const definition: Definition<Dictionary<any>> = { | ||
type: 'Dictionary', | ||
item: { | ||
type: 'any', | ||
}, | ||
export const definition = { | ||
type: 'Dictionary' | ||
}; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
182720
-1.39%210
-0.94%3947
-0.13%