Skip to content

Fix JSON deserialization error for abstract DrapoComponentFile in bot requests#613

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-config-content-error
Draft

Fix JSON deserialization error for abstract DrapoComponentFile in bot requests#613
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-config-content-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 5, 2026

Bot requests (crawlers, search engines) were failing with JsonSerializationException when attempting to deserialize DrapoConfig containing the abstract DrapoComponentFile class.

Changes

  • GetConfigContentForBot(): Replace full object deserialization with JObject manipulation to modify CanUseWebSocket property directly
  • GetConfigContentForRequestAsync(): Replace deserialization with JArray manipulation when merging dynamic routes to avoid instantiating abstract classes

Before

DrapoConfig configBot = JsonConvert.DeserializeObject<DrapoConfig>(configContent);
configBot.CanUseWebSocket = false;
return JsonConvert.SerializeObject(configBot);

After

JObject configJson = JObject.Parse(configContent);
configJson["CanUseWebSocket"] = false;
return configJson.ToString(Formatting.None);

Both methods now manipulate JSON structure directly, avoiding deserialization of objects containing abstract class members.

Original prompt

This section details on the original issue you should resolve

<issue_title>Request error getting the config content for bots</issue_title>
<issue_description>We are getting this error bellow when trying to get the config content for bots

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: silvath <2657156+silvath@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix request error getting config content for bots Fix JSON deserialization error for abstract DrapoComponentFile in bot requests Jan 5, 2026
Copilot AI requested a review from silvath January 5, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request error getting the config content for bots

2 participants