When creating a virtual event through the /virtual-events/v1/virtual-events/create
endpoint, pushing an invalid category does not throw an error but rather allows the invalid input and blanks the event category, setting it to a category called “System Update” which doesn’t exist.
The C# code sample is below (some code is from my own framework). Note the eventCategories
line.
object body = new
{
title = settings.Title,
subtitle = settings.Subtitle,
description = settings.Description,
placeId = Id,
universeId = Experience.Id,
groupId = groupid,
eventTime = new { startTime = settings.StartTime.Value.ToString("s"), endTime = settings.EndTime.Value.ToString("s") },
eventCategories = new[] { new { category = "some junk here", rank = 0 } },
visibility = settings.Visibility.ToString().ToLower(),
};
HttpMessage payload = new(HttpMethod.Post, $"/virtual-events/v1/virtual-events/create", body)
{
AuthType = AuthType.RobloSecurity,
ApiName = nameof(CreateVirtualEventAsync)
};
HttpResponseMessage response = await SendAsync(payload, Constants.URL("apis"));
Expected behavior
The Web endpoint should reject the request and state that an invalid category is provided, or reset the category to a default option. Instead, the input is accepted, and set to a category that does not seemingly exist as it’s not in the dropdown options.