This PR let our models to use the usageFlags from TCGC directly. Since the usage flags from TCGC is a bitmap which is a number, if we do nothing, the serialized tspCodeModel.json will have usage properties with integer values, which is not quite readable.
Therefore an additional change is that I added a replacer to replace the number value usage to string during serialization.
We could use similar way in the future to remove the __raw when we want to directly use the models from TCGC to serialize.
Checklist
To ensure a quick review and merge, please ensure:
[ ] The PR has a understandable title and description explaining the why and what.
[ ] The PR is opened in draft if not ready for review yet.
If opened in draft, please allocate sufficient time (24 hours) after moving out of draft for review
[ ] The branch is recent enough to not have merge conflicts upon creation.
Ready to Land?
[ ] Build is completely green
Submissions with test failures require tracking issue and approval of a CODEOWNER
[ ] At least one +1 review by a CODEOWNER
[ ] All -1 reviews are confirmed resolved by the reviewer
Override/Marking reviews stale must be discussed with CODEOWNERS first
Fixes https://github.com/Azure/autorest.csharp/issues/4820 Fixes https://github.com/Azure/autorest.csharp/issues/4734
Description
This PR let our models to use the usageFlags from TCGC directly. Since the usage flags from TCGC is a bitmap which is a number, if we do nothing, the serialized
tspCodeModel.json
will haveusage
properties with integer values, which is not quite readable. Therefore an additional change is that I added areplacer
to replace the number value usage to string during serialization. We could use similar way in the future to remove the__raw
when we want to directly use the models from TCGC to serialize.Checklist
To ensure a quick review and merge, please ensure:
Ready to Land?