-
Notifications
You must be signed in to change notification settings - Fork 480
chore(swagger): Add Swagger annotations Batch Testing Base (#32529) #32561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(swagger): Add Swagger annotations Batch Testing Base (#32529) #32561
Conversation
|
Semgrep found 2
The application builds a file path from potentially untrusted data, which can lead to a path traversal vulnerability. An attacker can manipulate the path which the application uses to access files. If the application does not validate user input and sanitize file paths, sensitive files such as configuration or user data can be accessed, potentially creating or overwriting files. To prevent this vulnerability, validate and sanitize any input that is used to create references to file paths. Also, enforce strict file access controls. For example, choose privileges allowing public-facing applications to access only the required files. In Java, you may also consider using a utility method such as View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L583 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 583] multipart</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L583 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 583] multipart</a>"]
v3["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L591 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 591] multiPartContent</a>"]
v4["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L594 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 594] requestFiles</a>"]
v5["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L595 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 595] files</a>"]
v6["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L607 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 607] uploadedBundleFile</a>"]
v7["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L607 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 607] uploadedBundleFile</a>"]
end
v2 --> v3
v3 --> v4
v4 --> v5
v5 --> v6
v6 --> v7
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rest/api/v1/osgi/OSGIResource.java#L609 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 609] felixUploadFolder + File.separator + uploadedBundleFile.getName()</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
If this is a critical or high severity finding, please also link this issue in the #security channel in Slack. Semgrep found 1 User data flows into a script engine or another means of dynamic code evaluation. This is unsafe and could lead to code injection or arbitrary code execution as a result. Avoid inputting user data into code execution or use proper sandboxing if user code evaluation is necessary. View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L126 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 126] bodyMap</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L126 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 126] bodyMap</a>"]
v3["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L128 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 128] new</a>"]
v4["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L128 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 128] processRequest</a>"]
v5["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L999 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 999] requestParams</a>"]
v6["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L1002 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1002] request</a>"]
v7["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L1043 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1043] evalJavascript</a>"]
v8["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L1067 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1067] request</a>"]
end
v2 --> v3
v3 --> v4
v4 --> v5
v5 --> v6
v6 --> v7
v7 --> v8
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/dotCMS/core/blob/05c237359f780dba2d79dc2332adcf2a12c122f7/dotCMS/src/main/java/com/dotcms/rendering/js/JsResource.java#L1082 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1082] request</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
If this is a critical or high severity finding, please also link this issue in the #security channel in Slack. |
05c2373 to
16b48e4
Compare
|
Semgrep found 1 The application builds a file path from potentially untrusted data, which can lead to a path traversal vulnerability. An attacker can manipulate the path which the application uses to access files. If the application does not validate user input and sanitize file paths, sensitive files such as configuration or user data can be accessed, potentially creating or overwriting files. To prevent this vulnerability, validate and sanitize any input that is used to create references to file paths. Also, enforce strict file access controls. For example, choose privileges allowing public-facing applications to access only the required files. In Java, you may also consider using a utility method such as View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>dotCMS/src/main/java/com/dotcms/rest/ContentResource.java</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1359 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1359] multipart</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1359 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1359] multipart</a>"]
v3["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1363 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1363] multipartPUTandPOST</a>"]
v4["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1412 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1412] multipart</a>"]
v5["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1427 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1427] part</a>"]
v6["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1427 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1427] part</a>"]
v7["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1507 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1507] processFile</a>"]
v8["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1539 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1539] part</a>"]
v9["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1542 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1542] badFileName</a>"]
v10["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1543 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1543] filename</a>"]
end
v2 --> v3
v3 --> v4
v4 --> v5
v5 --> v6
v6 --> v7
v7 --> v8
v8 --> v9
v9 --> v10
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1558 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1558] tmpFolder.getAbsolutePath() + File.separator + filename</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
If this is a critical or high severity finding, please also link this issue in the #security channel in Slack. Semgrep found 1
Detected user input controlling a file path. An attacker could control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are sanitized. You may also consider using a utility method such as org.apache.commons.io.FilenameUtils.getName(...) to only retrieve the file name from the path. View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>dotCMS/src/main/java/com/dotcms/rest/ContentResource.java</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1359 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1359] multipart</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1359 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1359] multipart</a>"]
v3["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1363 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1363] multipartPUTandPOST</a>"]
v4["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1412 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1412] multipart</a>"]
v5["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1427 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1427] part</a>"]
v6["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1427 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1427] part</a>"]
v7["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1507 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1507] processFile</a>"]
v8["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1539 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1539] part</a>"]
v9["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1542 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1542] badFileName</a>"]
v10["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1543 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1543] filename</a>"]
end
v2 --> v3
v3 --> v4
v4 --> v5
v5 --> v6
v6 --> v7
v7 --> v8
v8 --> v9
v9 --> v10
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/dotCMS/core/blob/16b48e49d9414c94c9e5377b106ee28a3044f30a/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L1557 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 1557] new File(<br> tmpFolder.getAbsolutePath() + File.separator + filename)</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
If this is a critical or high severity finding, please also link this issue in the #security channel in Slack. |
14def2c to
18f1564
Compare
18f1564 to
555a775
Compare
555a775 to
7e207da
Compare
f14b7d8 to
3f8c0b1
Compare
4b2edac to
985673f
Compare
985673f to
9825f41
Compare
- Modified SwaggerCompliantAnnotationTest to skip resources without @SwaggerCompliant - Updated SwaggerCompliantBatchTest to handle missing annotations gracefully - Enhanced RestEndpointAnnotationComplianceTest with better error handling - Improved SwaggerCompliantCumulativeTest exception handling for class loading - Tests now log warnings for unannotated resources instead of failing - Supports progressive rollout where annotation infrastructure is introduced first 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Removed SwaggerCompliantCumulativeTest as it's not needed for progressive rollout - Test was expecting specific batch counts that don't exist yet - Simplified approach: only test what is actually annotated 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
9825f41 to
0ca7036
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Argument Order in Constructor Calls
The constructors for ResponseEntityTagInodeOperationView and ResponseEntityTagOperationView incorrectly pass the errors list as the first argument to their super() calls. This violates the ResponseEntityView constructor signature, which expects the main data object (e.g., tagInodes, additionalData) as the first argument, followed by errors. The calls should be super(data, errors).
dotCMS/src/main/java/com/dotcms/rest/ResponseEntityTagInodeOperationView.java#L13-L16
core/dotCMS/src/main/java/com/dotcms/rest/ResponseEntityTagInodeOperationView.java
Lines 13 to 16 in 0ca7036
| public class ResponseEntityTagInodeOperationView extends ResponseEntityView<List<TagInode>> { | |
| public ResponseEntityTagInodeOperationView(final List<ErrorEntity> errors, final List<TagInode> tagInodes) { | |
| super(errors, tagInodes); | |
| } |
dotCMS/src/main/java/com/dotcms/rest/ResponseEntityTagOperationView.java#L14-L17
core/dotCMS/src/main/java/com/dotcms/rest/ResponseEntityTagOperationView.java
Lines 14 to 17 in 0ca7036
| public class ResponseEntityTagOperationView extends ResponseEntityView<Map<String, Object>> { | |
| public ResponseEntityTagOperationView(final ImmutableList<ErrorEntity> errors, final Map<String, Object> additionalData) { | |
| super(errors, additionalData); | |
| } |
Was this report helpful? Give feedback by reacting with 👍 or 👎
dcolina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to suggest to this phase. 👍🏽 Green light
dotCMS/src/main/java/com/dotcms/rest/api/v1/event/ResponseEntityEventErrorView.java
Show resolved
Hide resolved
jdotcms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job
dotCMS/src/main/java/com/dotcms/rest/api/v1/pushpublish/ResponseEntityFilterErrorView.java
Show resolved
Hide resolved
…on & User Management (#32656) ## Summary Progressive implementation of Swagger/OpenAPI annotations for REST endpoints - Batch 1 This PR adds comprehensive Swagger annotations to **15 REST resource classes** focused on core authentication and user management APIs that most applications depend on. ## 🔗 Foundation Dependency **⚠️ This PR depends on the infrastructure established in PR #32561** - **Foundation PR**: [#32561 - Progressive Swagger annotations infrastructure](#32561) - **Requirement**: PR #32561 must be merged before this PR can be reviewed/merged - **Why**: This PR uses the `@SwaggerCompliant` annotation and progressive testing framework created in #32561 ##⚠️ IMPORTANT: Batch Rollout Process **This PR is part of a progressive 8-batch rollout strategy established in PR #32561.** - 🔧 **Foundation**: [PR #32561](#32561) - Must be merged first - ✅ **Batch 1**: Ready for review after foundation is merged (this PR) - ⏳ **Batch 2**: [PR #32657](#32657) - Keep in draft until Batch 1 is merged - ⏳ **Batch 3-8**: Keep in draft until previous batch is merged - ⏳ **Batch 9**: [PR #32664](#32664) - Keep in draft until Batch 8 is merged **Do not remove draft state from subsequent batches until the previous batch has been successfully merged.** ## 🎯 Automatic Testing Integration This PR leverages the infrastructure from #32561 to enable **automatic testing**: - ✅ **Before this PR**: These 15 resources are not tested by compliance tests - ✅ **After this PR**: Resources are automatically discovered and tested via `@SwaggerCompliant` annotations - ✅ **Cumulative**: Future batches will test these resources plus their new ones ```bash # Test only Batch 1 classes (using infrastructure from #32561) ./mvnw test -pl :dotcms-core -Dtest=RestEndpointAnnotationComplianceTest -Dtest.batch.max=1 ``` ## Batch 1: Core Authentication & User Management (15 classes) **Theme**: Essential user and authentication APIs that most applications depend on ### Authentication Resources (7 classes) - `AuthenticationResource` - Core authentication endpoints - `ApiTokenResource` - API token management - `LoginFormResource` - Login form handling - `LogoutResource` - User logout functionality - `CreateJsonWebTokenResource` - JWT token creation - `ForgotPasswordResource` - Password reset requests - `ResetPasswordResource` - Password reset completion ### User Management Resources (3 classes) - `UserResource` - User CRUD operations - `PersonaResource` - User persona management - `PersonalizationResource` - User personalization settings ### System Role Resources (2 classes) - `RoleResource` - Role management - `PermissionResource` - Permission handling ### Legacy User Resources (3 classes) - `UserResource` (legacy) - Legacy user operations - `RoleResource` (legacy) - Legacy role operations - `DotSamlResource` - SAML authentication ## 🧪 Testing Strategy Uses the progressive testing framework established in #32561: ```bash # Test only Batch 1 classes (after #32561 is merged) ./mvnw test -pl :dotcms-core -Dtest=RestEndpointAnnotationComplianceTest -Dtest.batch.max=1 # Test annotation validation ./mvnw test -pl :dotcms-core -Dtest=RestEndpointAnnotationValidationTest -Dtest.batch.max=1 ``` ## 📋 Example Annotation Usage This PR adds `@SwaggerCompliant` annotations (from #32561) to mark resources as properly documented: ```java @SwaggerCompliant(value = "Core authentication and user management APIs", batch = 1) @tag(name = "Authentication") @path("/v1/authentication") public class AuthenticationResource { // Properly annotated endpoints... } ``` ## 🎯 Impact - ✅ Improves API documentation for core authentication flows - ✅ Enables automatic testing of these 15 resources (via #32561 infrastructure) - ✅ Enables better developer experience with OpenAPI spec generation - ✅ Maintains backward compatibility - ✅ Follows established annotation patterns and standards ## 📊 Progress Tracking This PR is **Batch 1 of 8** in the progressive rollout: - **Total Resources**: 115 across 8 batches - **This Batch**: 15 resources (13% of total) - **Next**: Batch 2 (Content Management Core) - 14 resources ## 🔗 Related PRs - **Foundation**: [#32561 - Progressive Swagger annotations infrastructure](#32561) ← **Must merge first** - **Next**: [#32657 - Batch 2 (Content Management Core)](#32657) - **Complete chain**: See PR #32561 for full rollout plan ##⚠️ Merge Requirements 1. **Foundation PR #32561 must be merged first** 2. This PR can then be reviewed and merged 3. After this PR is merged, remove draft state from Batch 2 PR #32657 4. Continue sequential rollout through Batch 8 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Summary
This PR establishes the progressive testing infrastructure for Swagger/OpenAPI annotations implementation across 115 REST endpoints in dotCMS.
Note for reviewers. Most of the files in this PR add new view classes that are not yet used in this PR but are added in preparation and use of the individual Resource classes that we change in upcoming batches. We do not need to deeply review these new classes at this time as they will have no impact on functionality at this time.
In these batches we can also look at the openapi.yml that now gets generated and included in the commit for any resource changes. In this PR it confirms we are only changing and adding tag descriptions providing the categories for the upcoming batch changes. The main part of this PR is the additional test changes which are set to identify using an annotation the upcoming changed resource files and will test them when updated. In this PR these will essentially skip and do nothing.
🎯 Progressive Rollout Strategy
This PR creates the foundation for a 9-batch progressive rollout of Swagger annotations. The annotations will be added incrementally to make the large change manageable and allow for thorough testing at each stage.
This first PR does not actually modify any or the resources. It provides the testing framework that will pick up the updated resources when they are added. It also adds a few underlying fixes and additional View classes that will be used by the updated Resource classes when they are added but on their own will have no impact.
🔧 Infrastructure Components
1. @SwaggerCompliant Annotation System
dotCMS/src/main/java/com/dotcms/rest/annotation/SwaggerCompliant.java2. Progressive Testing Framework
RestEndpointAnnotationComplianceTest.javaRestEndpointAnnotationValidationTest.java@SwaggerCompliantannotations3. Cumulative Testing Support
📊 Batch Organization (115 REST Resources)
Batch 1: Core Authentication & User Management (15 classes)
PR: #32656 - Ready for review
Batch 2: Content Management Core (14 classes)
PR: #32657 - Draft
Batch 3: Site Architecture & Templates (14 classes)
PR: #32658 - Draft
Batch 4: System Administration (15 classes)
PR: #32659 - Draft
Batch 5: Publishing & Distribution (13 classes)
PR: #32660 - Draft
Batch 6: Rules Engine & Business Logic (14 classes)
PR: #32661 - Draft
Batch 7: Modern APIs & Specialized Services (17 classes)
PR: #32662 - Draft
Batch 8: Legacy & Utility Resources (13 classes)
PR: #32663 - Draft
Batch 9: Cleanup and Finalization
PR: #32664 - Draft
🔄 Automatic Testing Integration
Key Feature: When annotations are added to REST resources, they automatically trigger testing of those resources when the PRs are merged.
This ensures that:
📋 Rollout Process
Phase 1: Foundation (This PR)
Phase 2: Progressive Rollout (Batches 1-8)
Phase 3: Finalization (Batch 9)
🧪 Testing Strategy
During Rollout
Each batch PR includes comprehensive testing:
After Completion
All tests run against all endpoints automatically:
📝 Documentation
Batch Documentation
SWAGGER_COMPLIANT_BATCHES.mdVerification Tests
SwaggerCompliantAnnotationTest.javaSwaggerCompliantBatchTest.java🎯 Benefits
🔗 Related PRs
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
This PR fixes: #32529