You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I remove the line ...Record<unknown>, it does not change.
The result does not really have anything for the spreaded Record, which might be a bug: we should either support this fully or forbid it instead of ignoring it.
And if making a decorator is not an option, I believe making the above tsp working as expected might be the solution of this issue to enable a model to both have base model and additional properties.
The text was updated successfully, but these errors were encountered:
In our current practice, additional properties on a model is expressed as
or
where the
Record<>
takes the position of base model.What if the model Foo needs a base model?
We have a similar case in swagger: https://github.com/Azure/azure-rest-api-specs/blob/64260c287d69860340a7c932f1450933dbb2c886/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/datafactory.json#L6381
This might be an issue when we try to migrate this from swagger to typespec.
And as a superset of swagger, I believe typespec should have the ability to define a model with both base model and additional properties.
BTW this will compile:
The corresponding openAPI2.0 result from this tsp looks like this:
If I remove the line
...Record<unknown>
, it does not change.The result does not really have anything for the spreaded
Record
, which might be a bug: we should either support this fully or forbid it instead of ignoring it.And if making a decorator is not an option, I believe making the above tsp working as expected might be the solution of this issue to enable a model to both have base model and additional properties.
The text was updated successfully, but these errors were encountered: