On /users/{id}/badges
, the description of the id
parameter
a semicolon delimited list of user ids
diverges from the inferred standard for multi-valued parameters:
A single primary key identifier or a vectorized, semicolon-delimited list of identifiers.
Is this intentional and is there a difference in the way "list" parameters are handled vs "vectorized" parameters?
It is my understanding that "vectorized" means that constituent values must be sorted in ascending order. Is this correct?
UPDATE:
Upon dumping all parameters I've come up with these variants:
id string A single primary key identifier or a vectorized, semicolon-delimited list of identifiers.
id string a semicolon delimited list of user ids
id string semi-colon delimited list of post ids
Can these all be treated similarly?
Conclusion
I got the answer I was looking for and am able to generate code that passes the following tests:
Tags (arbitrary number of strings):
[Test]
public void CheckParamArrayTags()
{
var client = new SoapiClient("api.stackoverflow.com", "");
QuestionsTaggedByTagsResponse response = client.QuestionsTaggedByTags("sqlite", "sqlite3", "c#").GetResult();
Assert.Greater(response.Questions.Count,0);
Assert.IsTrue(
response.Questions.All(
q => q.Tags.Contains("sqlite") && q.Tags.Contains("sqlite3") && q.Tags.Contains("c#")));
}
Ids (arbitrary number of int32)
[Test]
public void CheckParamArrayId()
{
var client = new SoapiClient("api.stackoverflow.com", "");
UsersByIdResponse response = client.UsersById(242897, 1).GetResult();
Assert.AreEqual(2, response.Users.Count);
Assert.IsTrue(response.Users.Any(u => u.UserId == 1));
Assert.IsTrue(response.Users.Any(u => u.UserId == 242897));
}