cyclosproject / ng-openapi-gen

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

Generate models from generic types #216

Closed heyligengregory closed 2 years ago

heyligengregory commented 2 years ago

Hi,

I have a generic response type on my endpoints, I was wondering if it's possible to generate api service with this because it needs :

  1. T class
  2. T class with concret class on API function

At this time, I have this error :

Error: Couldn't resolve reference #/components/schemas/MyApps.ItemsWithTotalCount%601[[MyApps.Models.DTO.InvoiceDto,%MyApps.Models,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=null]]

This is the configuration in swagger :

"responses": { "200": { "description": "Success", "content": { "text/json": { "schema": { "$ref": "#/components/schemas/MyApps.ItemsWithTotalCount``1[[MyApps.Models.DTO.InvoiceDto, MyApps.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]" } } } }

Thanks for your feedback

luisfpg commented 2 years ago

There's no support for generics in the OpenAPI spec.