Closed JeroMiya closed 4 years ago
This won't be trivial to implement, but let's see. Anyway, I'm still in vacations, and there is surely a pile of work to do when I'm back, so I can't set an ETA.
Cool, have a good vacation! If adding this scenario to the any
branch is easier to implement than calculating the proper union type, that would be an acceptable intermediate solution. Maybe with a warning?
There are often models defined as a set of fields plus an
additionalProperties
of various types, such asobject
. For example, here is the schema for aProblemDetails
model which is a representation of the RFC 7807 error response body:That is, the object has fields
type
,title
,status
,detail
,instance
, and can have additional properties of typeobject
.ng-openapi-gen
generates this model from the above schema:Unfortunately this doesn't compile:
This is because the indexer is only typed to the
additionalProperties
type. It also has to union in all the types of the other fields (or else just switch toany
with a warning?):