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

make subscirption id optional if there're tenant level operations #1869

Merged
merged 5 commits into from
May 26, 2023

Conversation

qiaozha
Copy link
Member

@qiaozha qiaozha commented May 25, 2023

fixes #1864
fixes #1772

@@ -607,3 +610,21 @@ function getMapperForSchema(
})
);
}

function isOperationTenantLevel(operation: Operation) {
Copy link
Member

@MaryGao MaryGao May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is my understanding correct?

If one operation has method-level subid defined, the isOperationTenantLevel would return true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly, an operation is tenant level if there are no client level subscriptionId parameter in the operation, that doesn't mean they need to have method level subscriptionId parameter, because they can even don't have subscriptionId as a parameter at all. The tenant level operation is the condition of adding this overloads to make the subscriptionId optional, but if the whole RP doesn't have any operation that contains the client level subscriptionId parameter, then subscriptionId doesn't even belongs to client constructor signature, then there is not need to add this overloads either.

Copy link
Member

@MaryGao MaryGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qiaozha qiaozha merged commit ed9a308 into Azure:main May 26, 2023
qiaozha added a commit that referenced this pull request May 29, 2023
* Add return types

* Version update

* Upgrade the cadl-ranch version to v15 (#1863)

* Upgrade the cadl-ranch version

* Add test cases for encode

* Typo fix

* Change to workspace

* Remove duplicate generation

* make subscirption id optional if there're tenant level operations (#1869)

* try fix subscriptionId in tenant level

* use overload to fix subscription optional

* refine and fix smoke test

* fix test and resolve comments

* fix sample transform

* Re-generate

* Add return types

* Version update

* Remove duplicate generation

* Re-generate

* Update

* re generate tests

* use workspace

* fix unit test

* fix integration test

---------

Co-authored-by: Mary Gao <yanmeigao1210@gmail.com>
Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>
Co-authored-by: qiaozha <qiaozha@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants