Rename Operation Ids with Or
conjunction causing AutoREST build errors
#3012
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The recent Open API pulls through the weekly open API refresh pipeline have introduced operation Ids with
Or
conjunction.For example,
user.onlineMeeting_createOrGet
is an operation Id introduced under a new path with aPOST
operation.AutoREST truncates everything to the right of a preposition or a conjunction, in this case
Or
. Therefore, operation iduser.onlineMeeting_createOrGet
ends up being interpreted asuser.onlineMeeting_create
. AutoREST will then try to detect the verbCreate
and map it toNew
from the truncated operation id, thus leaving you with a command subject ofuser.onlineMeeting_create
which is equal to an already existing operation Iduser_onlineMeeting_create
once_
and.
have been removed. This eventually causes build errors due to duplicate parameter types.See related issue here Azure/autorest.powershell#795
Solution
Replace the prepositions and conjunctions in the operationIds with "a unique made up temp word", that won't be truncated by AutoREST. Then once AutoREST is done generating the commands with the "made up words", rename them back to the correct prepositions and conjunctions.