Duplicate operation error when generating with the openapi-to-typespec converter
- Dominant language
- TypeSpec
- Stars
- 4.8k
- Forks
- 736
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 1
Description
I am attempting to convert the File Storage spec: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/storage/data-plane/Microsoft.FileStorage/stable/2026-04-06/file.json, but I am getting the following errors:
```
error | DuplicateOperation | Duplicate Operation 'Service' > 'SetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /
- put /
error | DuplicateOperation | Duplicate Operation 'Service' > 'GetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /
- get /
error | DuplicateOperation | Duplicate Operation 'Service' > 'ListSharesSegment' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /
- get /
error | DuplicateOperation | Duplicate Operation 'Service' > 'GetUserDelegationKey' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- post /
- post /
error | DuplicateOperation | Duplicate Operation 'Share' > 'Create' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'GetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}
- get /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'Delete' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- delete /{shareName}
- delete /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'AcquireLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'ReleaseLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'ChangeLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'RenewLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'BreakLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'CreateSnapshot' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'CreatePermission' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'GetPermission' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}
- get /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'SetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'SetMetadata' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'GetAccessPolicy' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}
- get /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'SetAccessPolicy' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'GetStatistics' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}
- get /{shareName}
error | DuplicateOperation | Duplicate Operation 'Share' > 'Restore' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}
- put /{shareName}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'Create' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}
- put /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'GetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}
- get /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'Delete' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- delete /{shareName}/{directory}
- delete /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'SetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}
- put /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'SetMetadata' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}
- put /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'ListFilesAndDirectoriesSegment' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}
- get /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'ListHandles' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}
- get /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'ForceCloseHandles' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}
- put /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'Directory' > 'Rename' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}
- put /{shareName}/{directory}
error | DuplicateOperation | Duplicate Operation 'File' > 'Create' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'Download' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}/{fileName}
- get /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'GetProperties' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- head /{shareName}/{directory}/{fileName}
- head /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'Delete' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- delete /{shareName}/{directory}/{fileName}
- delete /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'SetHTTPHeaders' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'SetMetadata' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'AcquireLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'ReleaseLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'ChangeLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'BreakLease' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'UploadRange' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'UploadRangeFromURL' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'GetRangeList' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}/{fileName}
- get /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'StartCopy' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'AbortCopy' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'ListHandles' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}/{fileName}
- get /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'ForceCloseHandles' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'Rename' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'CreateSymbolicLink' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'GetSymbolicLink' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- get /{shareName}/{directory}/{fileName}
- get /{shareName}/{directory}/{fileName}
error | DuplicateOperation | Duplicate Operation 'File' > 'CreateHardLink' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:
- put /{shareName}/{directory}/{fileName}
- put /{shareName}/{directory}/{fileName}
warning | Schema Missing Name '{"choices":[{"value":"service","language":{"default":{"name":"service","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"properties","language":{"default":{"name":"properties","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"2026-02-06","language":{"default":{"name":"2026-02-06","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"list","language":{"default":{"name":"list","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"userdelegationkey","language":{"default":{"name":"userdelegationkey","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"share","language":{"default":{"name":"share","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"lease","language":{"default":{"name":"lease","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"snapshot","language":{"default":{"name":"snapshot","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"filepermission","language":{"default":{"name":"filepermission","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"metadata","language":{"default":{"name":"metadata","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"acl","language":{"default":{"name":"acl","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"stats","language":{"default":{"name":"stats","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"undelete","language":{"default":{"name":"undelete","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"directory","language":{"default":{"name":"directory","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"listhandles","language":{"default":{"name":"listhandles","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"forceclosehandles","language":{"default":{"name":"forceclosehandles","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"rename","language":{"default":{"name":"rename","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"file","language":{"default":{"name":"file","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"range","language":{"default":{"name":"range","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"rangelist","language":{"default":{"name":"rangelist","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"copy","language":{"default":{"name":"copy","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"abort","language":{"default":{"name":"abort","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"symboliclink","language":{"default":{"name":"symboliclink","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
warning | Schema Missing Name '{"choices":[{"value":"hardlink","language":{"default":{"name":"hardlink","description":""}}}],"type":"choice","choiceType":{"type":"string","language":{"default":{"name":"string","description":"simple string"}},"protocol":{}},"language":{"default":{"name":"","description":""}},"protocol":{}}'.
error | Duplicate object schemas with 'KeyInfo' name detected.
error | Duplicate object schemas with 'UserDelegationKey' name detected.
error | Duplicate object schemas with '' name detected.
C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\node_modules\@autorest\modelerfour\dist\main.js - FAILURE {} Error: 54 errors occured -- cannot continue.
at Session.checkpoint (C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\libs\extension-base\dist\session.js:70:1)
at processRequest (C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\node_modules\@autorest\src\checker\plugin-checker.ts:26:15)
at C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\libs\extension-base\dist\autorest-extension.js:47:1
PLUGIN FAILURE: 54 errors occured -- cannot continue., Error: 54 errors occured -- cannot continue.
at Session.checkpoint (C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\libs\extension-base\dist\session.js:70:1)
at processRequest (C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\node_modules\@autorest\src\checker\plugin-checker.ts:26:15)
at C:\Users\caperal\.autorest\@autorest_modelerfour@4.27.0\libs\extension-base\dist\autorest-extension.js:47:1, {}
fatal | Error: 54 errors occured -- cannot continue.
fatal | Process() cancelled due to exception : Plugin checker reported failure. / Error: Plugin checker reported failure.
at C:\Users\caperal\.autorest\@autorestcore@3.10.1\node_modules\@autorest\core\dist\src_lib_autorest-corets.js:2835:19
at ScheduleNode (C:\Users\caperal\.autorest\@autorestcore@3.10.1\node_modules\@autorest\core\dist\src_lib_autorest-corets.js:1351:29)
error | Error: Plugin checker reported failure.
error | Autorest completed with an error. If you think the error message is unclear, or is a bug, please declare an issues at https://github.com/Azure/autorest/issues with the error message you are seeing.
debug | [35.58 s] Shutting Down.
debug | [35.58 s] Exiting.
```
I believe this is happening due to the x-ms-paths in the storage spec. Is there a way the converter can attempt to disambiguate the operations and still convert this spec?
Contributor guide
Research direction
Reproduce the failure with the linked Microsoft.FileStorage file.json using the openapi-to-typespec converter. Start by tracing how the converter handles the repeated operation paths and operation names shown in the diagnostics. Done means the converter no longer emits the listed duplicate-operation errors for this input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100