Skip to content

Conversation

@nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Jan 27, 2026

This pull request makes a minor update to the ProtocolDefinitionItem class in the DevTools generator, primarily affecting JSON serialization behavior for the description property.

Serialization improvements:

  • Marked the Description property with [JsonIgnore] to prevent it from being included in JSON serialization, ensuring only the internal InitialDescription is serialized.
  • Added [JsonInclude] to the InitialDescription property to explicitly allow its serialization, supporting correct deserialization and serialization of the description field.

🔗 Related Issues

Fixes #16715

💥 What does this PR do?

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Bug fix (backwards compatible)

@qodo-code-review
Copy link
Contributor

PR Type

Bug fix


Description

  • Fixes XML documentation generation for DevTools members

  • Adds [JsonIgnore] to Description property to prevent serialization

  • Adds [JsonInclude] to InitialDescription to ensure proper JSON serialization

  • Removes unnecessary blank line for code cleanup


File Walkthrough

Relevant files
Bug fix
ProtocolDefinitionItem.cs
Add JSON serialization attributes to DevTools protocol definition

third_party/dotnet/devtools/src/generator/ProtocolDefinition/ProtocolDefinitionItem.cs

  • Added [JsonIgnore] attribute to Description property to prevent it
    from being serialized
  • Added [JsonInclude] attribute to InitialDescription field to ensure
    proper JSON serialization
  • Removed unnecessary blank line after class declaration
  • Reordered attributes for better code organization
+2/-1     

@selenium-ci selenium-ci added the B-devtools Includes everything BiDi or Chrome DevTools related label Jan 27, 2026
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟢
🎫 #16715
🟢 Ensure XML documentation is generated/published for .NET DevTools types (e.g.,
OpenQA.Selenium.DevTools.V143.Accessibility.AXNode) so the API docs pages are not missing
member/type docs.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix null reference and incomplete escaping

Fix a potential NullReferenceException and incomplete XML escaping in the
Description property's getter by using System.Security.SecurityElement.Escape().

third_party/dotnet/devtools/src/generator/ProtocolDefinition/ProtocolDefinitionItem.cs [12-16]

 public string? Description
 {
-    get => InitialDescription?.Replace("<", "&lt;").Replace(">", "&gt;");
+    get => System.Security.SecurityElement.Escape(InitialDescription);
     set => InitialDescription = value;
 }
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a critical NullReferenceException bug and also points out the incomplete XML escaping, proposing a robust fix using a standard library method.

High
  • More

@nvborisenko nvborisenko merged commit 406ec40 into SeleniumHQ:trunk Jan 27, 2026
20 checks passed
@nvborisenko nvborisenko deleted the dotnet-devtools-xml-docs branch January 27, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-devtools Includes everything BiDi or Chrome DevTools related Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: [dotnet] Missing generated xml docs for DevTools types

2 participants