Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
8 stars 29 forks source link

[CanonicalEmitter] Add option and isArmCommonType check #1065

Closed dinwa-ms closed 1 week ago

dinwa-ms commented 2 weeks ago

This PR addressed 2 issues:

  1. add option "use-read-only-status-schema" to fix ProvisioningStateMustBeReadOnly bug; The bug is mentioned here https://github.com/Azure/azure-rest-api-specs/discussions/29471 and the suggested walkaround is set option "use-read-only-status-schema" to true. Canonical emitter doesn't have this option. So add this option to the emitter. image

  2. add isArmCommonType check to avoid decorator validation in canonical emitter Canonical emitter will generate warning when @typeChangedFrom decorator is used. To make sure this not apply to common type, add isArmCommonType check