Thank you. Is there a way to say the input struct must have keys “class_id” and “user_id”? I can’t seem to find or figure out the right syntax for that.
I do not remember if literal strings are allowed as key-types in a map, as they simply aren’t allowed everywhere, but if they are allowed required("foo") => any should do.
I see. I should not be getting string keys into this function in the first place, so I will refactor accordingly, and that will solve the problem, taking into account what @benwilson512 also wrote. Thank you both!