A bug related to the directive transform
See original GitHub issueBefore filling a bug
- have you checked the faq for known issues.
- have you checked existing issues
I use a transform directive as below to make a change on the generated C# code.
- from: TrackedResourceTags.dictionary.cs
where: $
transform: $ = $.replace(/null != property.Key && null != property.Value/g, 'null != property.Key');
The weird thing is it works in Linux but not in Windows.
If you want to reproduce the issue, you may add the directive above in https://github.com/Azure/azure-powershell/blob/generation/src/Databricks/README.md and then run autorest in the Databricks folder in a Windows machine.
I run autorest --debug in both Windows and Linux. The only different I can see from the log is that in Linux, we have something like below in the log while Windows not.
debug | [13.02 s] Running text transform 'TrackedResourceTags.dictionary.cs/undefined' on mem:///267?generated%2Fapi%2FModels%2FApi20210401Preview%2FTrackedResourceTags.dictionary.cs
I tend to think the issue is in https://github.com/Azure/autorest/blob/main/packages/extensions/core/src/lib/plugins/transformer/transformer.ts#L28.
BTW, I use node 14.15.5 and autorest core version is 3.9.3.
Please provide as much information as you can. This would be:
- OpenAPI files having the issues
- Autorest command used
Expected behavior A clear and concise description of what you expected to happen.
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
@dolauli can you verify this is fixing the problem? https://github.com/Azure/autorest/pull/4683#issuecomment-1339729111
@timotheeguerin Verified the issue is fixed.