Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Operation Ids with Or conjunction causing AutoREST build errors #3012

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

timayabi2020
Copy link
Contributor

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 a POST operation.
AutoREST truncates everything to the right of a preposition or a conjunction, in this case Or. Therefore, operation id user.onlineMeeting_createOrGet ends up being interpreted as user.onlineMeeting_create. AutoREST will then try to detect the verb Create and map it to New from the truncated operation id, thus leaving you with a command subject of user.onlineMeeting_create which is equal to an already existing operation Id user_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.

@timayabi2020 timayabi2020 requested a review from a team as a code owner October 28, 2024 09:14
@timayabi2020 timayabi2020 merged commit 09855d3 into dev Oct 28, 2024
2 checks passed
@timayabi2020 timayabi2020 deleted the fix/autorestgen1 branch October 28, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants