Skip to content

Add checkstyle rule to validate serialization method completeness#47916

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/add-checkstyle-rule-validation
Draft

Add checkstyle rule to validate serialization method completeness#47916
Copilot wants to merge 6 commits intomainfrom
copilot/add-checkstyle-rule-validation

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

This pull request introduces a new custom Checkstyle rule to enforce serialization method requirements for classes implementing JsonSerializable or XmlSerializable. It also updates relevant configuration files and dependencies to support this new rule.

New Checkstyle rule for serialization methods:

  • Added SerializableMethodsCheck to linting-extensions, which verifies that classes implementing JsonSerializable or XmlSerializable provide a static fromJson or fromXml method, respectively. (sdk/tools/linting-extensions/src/main/java/io/clientcore/linting/extensions/checkstyle/checks/SerializableMethodsCheck.java)
  • Added comprehensive unit tests for SerializableMethodsCheck to ensure correct behavior across various scenarios, including missing methods, nested classes, and multiple interfaces. (sdk/tools/linting-extensions/src/test/java/io/clientcore/linting/extensions/checkstyle/checks/SerializableMethodsCheckTest.java)

Checkstyle configuration updates:

  • Registered the new SerializableMethodsCheck in the Checkstyle configuration files for clientcore, track2, and vnext, enabling enforcement across multiple codebases. (eng/lintingconfigs/checkstyle/clientcore/checkstyle.xml, eng/lintingconfigs/checkstyle/track2/checkstyle.xml, eng/lintingconfigs/checkstyle/vnext/checkstyle.xml) [1] [2] [3]

Dependency and version updates:

  • Updated the linting-extensions dependency version from 1.0.0-beta.1 to 1.0.0-beta.2 in all relevant parent POM files to ensure the new rule is available. (sdk/parents/azure-client-sdk-parent-v2/pom.xml, sdk/parents/azure-client-sdk-parent/pom.xml, sdk/parents/azure-data-sdk-parent/pom.xml, sdk/parents/clientcore-parent/pom.xml) [1] [2] [3] [4]
  • Updated the version_client.txt file to reference the new unreleased version of linting-extensions. (eng/versioning/version_client.txt)

Copilot AI and others added 2 commits February 5, 2026 21:39
… validation

Co-authored-by: srnagar <51379715+srnagar@users.noreply.github.com>
Co-authored-by: srnagar <51379715+srnagar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add checkstyle rule for serialization methods validation Add checkstyle rule to validate serialization method completeness Feb 5, 2026
Copilot AI requested a review from srnagar February 5, 2026 21:43
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

io.clientcore:linting-extensions

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.

2 participants