epugh commented on code in PR #4178:
URL: https://github.com/apache/solr/pull/4178#discussion_r4524502186


##########
solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java:
##########
@@ -14,34 +14,30 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package org.apache.solr.client.api.model;
 
-package org.apache.solr.client.solrj.request.beans;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
 import java.util.List;
-import org.apache.solr.common.annotation.JsonProperty;
-import org.apache.solr.common.util.ReflectMapWriter;
-
-/** Just a container class for POJOs used in Package APIs */
-public class PackagePayload {
-  public static class AddVersion implements ReflectMapWriter {
-    @JsonProperty(value = "package", required = true)
-    public String pkg;
 
-    @JsonProperty(required = true)
-    public String version;
+/** Request body for adding a version of a package. */
+public class AddPackageVersionRequestBody {
 
-    @JsonProperty(required = true)
-    public List<String> files;
+  @JsonProperty("version")
+  @Schema(description = "The version string for this package version.", 
required = true)

Review Comment:
   Confirmed via the compiler (`-Xlint:deprecation`):
   
   ```
   AddPackageVersionRequestBody.java:27: warning: [deprecation] required() in 
Schema has been deprecated
   AddPackageVersionRequestBody.java:33: warning: [deprecation] required() in 
Schema has been deprecated
   ```
   
   `@Schema(required = true)` is deprecated in favor of `@Schema(requiredMode = 
Schema.RequiredMode.REQUIRED)`. That said, this isn't something to fix just 
here -- 19 other files under 
`solr/api/src/java/org/apache/solr/client/api/model/` use the exact same 
`required = true` attribute, so it's a pre-existing, codebase-wide pattern 
rather than something this PR introduced. Rather than fix it inconsistently in 
this one new file, I'll leave it as a follow-up to do as its own small cleanup 
PR across the whole module.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to