Open noah-stahl opened 4 months ago
Thanks for using the Ruby SDK and for reaching out. For sanity, do you get the same result with ?
new_group = MicrosoftGraph::Models::Group.new()
new_group.display_name = 'My new Group'
new_group.mail_enabled = false
new_group.mail_nickname = 'newgroup'
new_group.security_enabled = true
new_group.group_types = ['Unified']
Hi, thanks for the quick answer. I tried that and got the same result. This is what my group object looks like before I try to post it, so it seems to have all the necessary attributes
<MicrosoftGraph::Models::Group:0x0000ffff93f29ef8 @additional_data={}, @odata_type="#microsoft.graph.group", @display_name="My new Group", @mail_enabled=false, @mail_nickname="newgroup", @security_enabled=true, @group_types=["Unified"]>
Looking at the request that is being sent, it seems like the request body is missing
That's a very good call-out. We had a fix for this very issue a couple of days ago. Make sure your version of abstractions is up to date with latest. https://github.com/microsoft/kiota-abstractions-ruby/pull/33
Thanks for the heads up, it seems I was on an older version. Unfortunately, I'm having some trouble getting all the dependencies to resolve correctly.
At first I tried simply specifying the version in my Gemfile
Gemfile
gem 'microsoft_graph', '~> 0.22.1'
gem 'microsoft_kiota_abstractions', '~> 0.14.4'
but the same issue persisted. I presume this is because the request is made by microsoft_kiota_faraday
, which is still using microsoft_kiota_abstractions 0.12.0
, as I could see in my Gemfile.lock
Gemfile.lock
microsoft_graph (0.22.1)
microsoft_graph_core (~> 0.3.1)
microsoft_graph_core (0.3.1)
microsoft_kiota_abstractions (~> 0.14.0)
microsoft_kiota_authentication_oauth (~> 0.8.0)
microsoft_kiota_faraday (~> 0.12.0)
microsoft_kiota_serialization_json (~> 0.9.0)
microsoft_kiota_abstractions (0.14.4)
iso8601 (~> 0.13.0)
stduritemplate (~> 0.0.39)
microsoft_kiota_authentication_oauth (0.8.0)
microsoft_kiota_abstractions (~> 0.14.0)
oauth2 (~> 2.0)
microsoft_kiota_faraday (0.12.0)
faraday (~> 2.7, >= 2.7.2)
microsoft_kiota_abstractions (~> 0.14.0)
microsoft_kiota_serialization_json (0.9.1)
json (~> 2.6.3)
microsoft_kiota_abstractions (~> 0.14.0)
uuidtools (~> 2.2.0)
I tried to use the newest version of microsoft_kiota_faraday
which is as of very recently 0.14.0
, by specifying it in my Gemfile
Gemfile
gem 'microsoft_graph', '~> 0.22.1'
gem 'microsoft_kiota_abstractions', '~> 0.14.4'
gem 'microsoft_kiota_faraday', '~> 0.14.0'
But that seems to be impossible because of microsoft_graph
and microsoft_graph_core
depending on microsoft_kiota_faraday ~> 0.12.0
, I get the following error
> bundle install
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Could not find compatible versions
Because microsoft_graph >= 0.20.0 depends on microsoft_graph_core ~> 0.3.1
and microsoft_graph_core >= 0.3.1 depends on microsoft_kiota_faraday ~> 0.12.0,
microsoft_graph >= 0.20.0 requires microsoft_kiota_faraday ~> 0.12.0.
So, because Gemfile depends on microsoft_graph ~> 0.22.1
and Gemfile depends on microsoft_kiota_faraday ~> 0.14.0,
version solving has failed.
Ok, let's unblock you with two pull requests. Can you first prepare a release of core by:
After that gets published, I'll ask you to do the same here.
Core release is out, please go ahead with the same for this repo. Please review the changes I've pushed to the changelog in the first pr and align with that.
0.22.2 was just released which should fix your issue. Closing. Thanks for the help getting the releases out! Don't hesitate if you need more help!
Thanks for the help, I've updated to the 0.22.2 version and my Gemfile.lock looks like this now
microsoft_graph (0.22.2)
microsoft_graph_core (~> 0.3.1)
microsoft_graph_core (0.3.2)
microsoft_kiota_abstractions (~> 0.14.0)
microsoft_kiota_authentication_oauth (~> 0.8.0)
microsoft_kiota_faraday (>= 0.12, < 0.15)
microsoft_kiota_serialization_json (~> 0.9.0)
microsoft_kiota_abstractions (0.14.4)
iso8601 (~> 0.13.0)
stduritemplate (~> 0.0.39)
microsoft_kiota_authentication_oauth (0.8.0)
microsoft_kiota_abstractions (~> 0.14.0)
oauth2 (~> 2.0)
microsoft_kiota_faraday (0.14.0)
faraday (~> 2.7, >= 2.7.2)
microsoft_kiota_abstractions (~> 0.14.0)
microsoft_kiota_serialization_json (0.9.1)
json (~> 2.6.3)
microsoft_kiota_abstractions (~> 0.14.0)
uuidtools (~> 2.2.0)
So microsoft_kiota_faraday
is now on the 0.14.0
version, but unfortunately the problem of the blank request body is still unchanged
Thanks for your patience on the matter. I was out due to sick leave (my schedule is still impacted at this point).
I believe this issue is simply due to a dependencies mis-alignment.
I'm not sure how dependencies are managed in ruby (are they deduplicated like in dotnet/javascript/...? if so, what rationale is being applied? or are they isolated and multiple versions can be in the application context?) But getting clarity on the behaviour would be helpful.
What would be interesting to do to rule this out would be to clone all the repositories, and link all packages locally
Can you try this approach locally and report on the result please? If that solves the issue, we'll bump all versions and dependencies gradually on all repository to ensure people get only the latest aligned versions with the fix.
Another test worth performing would be to try get the serialized value (from the parse node) and see if the representation is what is expected before it's set on the request information's content. (see [this as an example]9https://github.com/microsoft/kiota-abstractions-ruby/blob/7367a156276923eddd22e52335adbba88b1bf71e/lib/microsoft_kiota_abstractions/request_information.rb#L96) you can just copy some of the code, pass the group object and checkout what will be in the resulting content, make sure you instantiate the client first to register the serialization providers)
I hope this helps. Let me know if you have further questions.
Hi, I'm trying to create a new group, I initialize a GraphServiceClient just like in the README
Then I try to build a Group object and POST it I pieced this code together by using this doc https://learn.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0 as well as another user's code from this issue https://github.com/microsoftgraph/msgraph-sdk-ruby/issues/163#issuecomment-1786640674
But I get an error back with the following message
A value is required for property 'displayName' of resource 'Group'.
What am I missing?