cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
397 stars 132 forks source link

Models generated can contains unknowns types #96

Closed Erim32 closed 4 years ago

Erim32 commented 4 years ago

Exemple of generated model: In the following case, uid and component are not ts valid types of data. Maybe change unknowns types to "any".

export interface Menu { description?: string; id: string; menusections?: Array<{ 'id': string, 'name': string, 'dishes'?: component, 'menu'?: string }>; restaurant?: { 'id': string, 'name': string, 'slug'?: uid, 'price_range'?: string, 'closing_period'?: component, 'contact_email'?: string, 'stars': number, 'averagePrice'?: number, 'address'?: string, 'cover'?: string, 'timestamp'?: timestamp, 'images'?: Array, 'short_description'?: string, 'since'?: string, 'categories'?: string, 'description': string, 'services'?: component, 'menu'?: string, 'opening_times'?: component, 'dz'?: dynamiczone }; }

luisfpg commented 4 years ago

Does the OpenAPI 3 spec allows referencing a property of an undeclared type? If it is not on the spec, it won't be support.