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
Currently, typespec-autorest converts an empty object ({}) to {"type": "object"} in Swagger. When using autorest to generate SDKs from these Swaggers, modelerfour converts this to the any type.
For our team (Azure PowerShell), our current strategy is as follows:
For the PowerShell emitter, we follow the same strategy as Java, which is to generate a named empty class.
This conversion results in different code being generated when using autorest with Swagger compared to using typespec with the emitter, which also means future breaking changes when we replace swagger based codegen with typespec based codegen.
Potential solutions:
Don't allow empty object in typespec, use Record< unknown > instead.
Extend Swagger and modelerfour to support named empty classes
Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
Clear and concise description of the problem
Currently, typespec-autorest converts an empty object ({}) to
{"type": "object"}
in Swagger. When using autorest to generate SDKs from these Swaggers, modelerfour converts this to the any type.For our team (Azure PowerShell), our current strategy is as follows:
For the PowerShell emitter, we follow the same strategy as Java, which is to generate a named empty class.
This conversion results in different code being generated when using autorest with Swagger compared to using typespec with the emitter, which also means future breaking changes when we replace swagger based codegen with typespec based codegen.
Potential solutions:
Checklist
The text was updated successfully, but these errors were encountered: