Add checkstyle rule to validate serialization method completeness#47916
Draft
Add checkstyle rule to validate serialization method completeness#47916
Conversation
… 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
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new custom Checkstyle rule to enforce serialization method requirements for classes implementing
JsonSerializableorXmlSerializable. It also updates relevant configuration files and dependencies to support this new rule.New Checkstyle rule for serialization methods:
SerializableMethodsChecktolinting-extensions, which verifies that classes implementingJsonSerializableorXmlSerializableprovide a staticfromJsonorfromXmlmethod, respectively. (sdk/tools/linting-extensions/src/main/java/io/clientcore/linting/extensions/checkstyle/checks/SerializableMethodsCheck.java)SerializableMethodsCheckto 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:
SerializableMethodsCheckin the Checkstyle configuration files forclientcore,track2, andvnext, 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:
linting-extensionsdependency version from1.0.0-beta.1to1.0.0-beta.2in 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]version_client.txtfile to reference the new unreleased version oflinting-extensions. (eng/versioning/version_client.txt)