[Feature] Adds support for specifying API version - #20
Conversation
|
Thanks for the PR, I will review shortly. |
|
That is true. Is supporting Azure AD Graph within the desired scope of this project? I have a couple of other changes to support it, which complement this pull request. I might just merge all my commits into a thorough pull request instead. |
|
It is not in scope to support Azure AD Graph; however, if there are abstractions we can introduce in the SDK to allow developers to use both, I think that would be appropriate. If you'd like to make two separate PRs, make sure you sign the CLA so that I can merge this PR. |
|
After this merge, using the Graph API with the api_version param set, results in an error: graph = MicrosoftGraph.new(
api_version: '1.0',
cached_metadata_file: File.join(MicrosoftGraph::CACHED_METADATA_DIRECTORY, 'metadata_v1.0.xml'),
&auth_callback
)
graph.me
Traceback (most recent call last):
1: from (irb):22
OData::ClientError (400 BadRequest: "Query parameter api-version not allowed" from "https://graph.microsoft.com/v1.0/me?api-version=1.0") |
Tenants at https://graph.windows.net/ require the
api-versionquery parameter to be present for any API calls. The use ofapi-versionis described in [1]This pull request adds a new (optional) API version option to tag all requests invoked from the Microsoft Graph instance.
[1] https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-graph-api-quickstart#graph-api-versions