JacobLinCool / JacobLinCool/moodle-rs

mod_assign_get_submissions gives "builder error: unsupported value"

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
6
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I think the problem is that the param "assignmentids" is of type Vec, and this cannot be serialized in urlencoded format.

```
async fn checker(client: &mut client::MoodleClient)
{
match mod_::assign::get_submissions::call(client, &mut mod_::assign::get_submissions::Params {
assignmentids: Some(vec!(ASSIGNMENT_ID)),
status: Some("".to_string()),
since: Some(0),
before: Some(0) }).await {
Ok(result) => {
println!("{:#?}", result);
},
Err(e) => {
println!("Error fetching submissions: {e}");
}
}
}
```

The error is thrown in `reqwest::async_impl::request::RequestBuilder::form()`
Could this be fixed by using json format for the post request in moodle_client?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at mod_::assign::get_submissions::call and its Params handling, then inspect the Moodle client request path around reqwest::async_impl::request::RequestBuilder::form(). Verify the chosen request encoding supports assignmentids as Vec and that the example call completes without the unsupported-value builder error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.