Can autorest support a flag to control the removeDuplicates of model naming property
Is your feature request related to a problem? Please describe. There's issue that I posted here https://github.com/Azure/autorest.csharp/issues/1667
I consume swagger file from vendor product so I cannot control the swagger file. Sometimes the swagger file contains property definition such as
BaseCurrSymbol BaseCurrSymbolCurrSymbol
The CodeModel.yaml output will contains
`
-
!Property schema: *ref_33 serializedName: BaseCurrSymbol language: !Languages default: name: baseCurrSymbol description: ''
-
!Property schema: *ref_74 serializedName: BaseCurrSymbolCurrSymbol language: !Languages default: name: baseCurrSymbol description: ''`
With this autorest csharp will generate a model with 2 property name BaseCurrSymbol
Describe the solution you'd like As I observe the fix from here https://github.com/Azure/autorest/pull/4166
Look like the naming is removing duplicated is control by this option
From the file autorest\packages\extensions\modelerfour\src\prenamer\naming-utils.ts
const setNameDefaultOptions: SetNameOptions = Object.freeze({
removeDuplicates: true,
nameEmptyErrorMessage: Name cannot be empty.,
});
Can we have a flag or kind of setting to control this option removeDuplicates
Can you confirm you are using the latest version of modelerfour and @autorest/core (docs. Bugs around deduplicate consecutive words naming have been resolved in the past.
Can you confirm you are using the latest version of modelerfour and @autorest/core (docs. Bugs around deduplicate consecutive words naming have been resolved in the past.
Yes I use the latest version of autorest and plugins. The deduplicate consecutive words naming works. In this case I want turn it off, I want it keeps the name as is in swagger file. As I understand when deduplicate consecutive naming It can produce duplicate property in the result model.
I think It also related to this issue https://github.com/Azure/autorest.csharp/issues/1613 when deduplicate consecutive naming turn on
I see, seems like that problem was still present for model properties. I fixed that instead of adding a new configuration.
PR here has some steps to try it out https://github.com/Azure/autorest/pull/4378, can you confirm this resolve your issue.