Apache Solr open-source search software
SOLR-16825: Remove unneeded @Produces annotations (#1885)
Jason Gerlowskiba80f82f64f6
diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/AddReplicaPropertyApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/AddReplicaPropertyApi.javaindex 9403358770a..8dce6a28e54 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/AddReplicaPropertyApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/AddReplicaPropertyApi.java@@ -17,15 +17,12 @@package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import io.swagger.v3.oas.annotations.parameters.RequestBody;import javax.ws.rs.PUT;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import org.apache.solr.client.api.model.AddReplicaPropertyRequestBody;import org.apache.solr.client.api.model.SolrJerseyResponse;@@ -33,7 +30,6 @@ import org.apache.solr.client.api.model.SolrJerseyResponse;public interface AddReplicaPropertyApi {@PUT- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Adds a property to the specified replica",tags = {"replica-properties"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/AliasPropertyApis.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/AliasPropertyApis.javaindex d993997d111..7bc167a2b36 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/AliasPropertyApis.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/AliasPropertyApis.java@@ -16,8 +16,6 @@*/package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import io.swagger.v3.oas.annotations.parameters.RequestBody;@@ -26,8 +24,6 @@ import javax.ws.rs.GET;import javax.ws.rs.PUT;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;-import javax.ws.rs.core.MediaType;import org.apache.solr.client.api.model.GetAliasPropertyResponse;import org.apache.solr.client.api.model.GetAllAliasPropertiesResponse;import org.apache.solr.client.api.model.SolrJerseyResponse;@@ -39,7 +35,6 @@ import org.apache.solr.client.api.model.UpdateAliasPropertyRequestBody;public interface AliasPropertyApis {@GET- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Get properties for a collection alias.",tags = {"alias-properties"})@@ -49,7 +44,6 @@ public interface AliasPropertyApis {@GET@Path("/{propName}")- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Get a specific property for a collection alias.",tags = {"alias-properties"})@@ -59,7 +53,6 @@ public interface AliasPropertyApis {throws Exception;@PUT- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Update properties for a collection alias.",tags = {"alias-properties"})@@ -71,7 +64,6 @@ public interface AliasPropertyApis {@PUT@Path("/{propName}")- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Update a specific property for a collection alias.",tags = {"alias-properties"})@@ -84,7 +76,6 @@ public interface AliasPropertyApis {@DELETE@Path("/{propName}")- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete a specific property for a collection alias.",tags = {"alias-properties"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteAliasApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteAliasApi.javaindex 24759ead2ad..05d32068683 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteAliasApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteAliasApi.java@@ -17,14 +17,11 @@package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import javax.ws.rs.DELETE;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import javax.ws.rs.QueryParam;import org.apache.solr.client.api.model.SolrJerseyResponse;@@ -32,7 +29,6 @@ import org.apache.solr.client.api.model.SolrJerseyResponse;public interface DeleteAliasApi {@DELETE- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Deletes an alias by its name",tags = {"aliases"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionApi.javaindex 9e28e7b1722..8cf0010066e 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionApi.java@@ -17,14 +17,11 @@package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import javax.ws.rs.DELETE;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import javax.ws.rs.QueryParam;import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;@@ -32,7 +29,6 @@ import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;public interface DeleteCollectionApi {@DELETE- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Deletes a collection from SolrCloud",tags = {"collections"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionBackupApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionBackupApi.javaindex 1135e4d89d7..e53f8ea96d7 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionBackupApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionBackupApi.java@@ -20,7 +20,6 @@ package org.apache.solr.client.api.endpoint;import static org.apache.solr.client.api.model.Constants.ASYNC;import static org.apache.solr.client.api.model.Constants.BACKUP_LOCATION;import static org.apache.solr.client.api.model.Constants.BACKUP_REPOSITORY;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.parameters.RequestBody;@@ -28,7 +27,6 @@ import javax.ws.rs.DELETE;import javax.ws.rs.PUT;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import javax.ws.rs.QueryParam;import org.apache.solr.client.api.model.BackupDeletionResponseBody;import org.apache.solr.client.api.model.PurgeUnusedFilesRequestBody;@@ -39,7 +37,6 @@ public interface DeleteCollectionBackupApi {@Path("/versions/{backupId}")@DELETE- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete incremental backup point by ID",tags = {"collection-backups"})@@ -54,7 +51,6 @@ public interface DeleteCollectionBackupApi {@Path("/versions")@DELETE- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete all incremental backup points older than the most recent N",tags = {"collection-backups"})@@ -69,7 +65,6 @@ public interface DeleteCollectionBackupApi {@Path("/purgeUnused")@PUT- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Garbage collect orphaned incremental backup files",tags = {"collection-backups"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionSnapshotApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionSnapshotApi.javaindex f9d1afc8387..fb77fbd6dc8 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionSnapshotApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteCollectionSnapshotApi.java@@ -17,14 +17,11 @@package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Parameter;import javax.ws.rs.DELETE;import javax.ws.rs.DefaultValue;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import javax.ws.rs.QueryParam;import org.apache.solr.client.api.model.DeleteCollectionSnapshotResponse;@@ -33,7 +30,6 @@ public interface DeleteCollectionSnapshotApi {/** This API is analogous to V1's (POST /solr/admin/collections?action=DELETESNAPSHOT) */@DELETE@Path("/collections/{collName}/snapshots/{snapshotName}")- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})DeleteCollectionSnapshotResponse deleteSnapshot(@Parameter(description = "The name of the collection.", required = true)@PathParam("collName")diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteNodeApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteNodeApi.javaindex 323b70dbabb..0495d298cb9 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteNodeApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteNodeApi.java@@ -17,15 +17,12 @@package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import io.swagger.v3.oas.annotations.parameters.RequestBody;import javax.ws.rs.POST;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import org.apache.solr.client.api.model.DeleteNodeRequestBody;import org.apache.solr.client.api.model.SolrJerseyResponse;@@ -33,7 +30,6 @@ import org.apache.solr.client.api.model.SolrJerseyResponse;public interface DeleteNodeApi {@POST- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete all replicas off of the specified SolrCloud node",tags = {"node"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaApi.javaindex a728c12aadc..f17abdfab26 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaApi.java@@ -24,14 +24,12 @@ import static org.apache.solr.client.api.model.Constants.DELETE_INDEX;import static org.apache.solr.client.api.model.Constants.DELETE_INSTANCE_DIR;import static org.apache.solr.client.api.model.Constants.FOLLOW_ALIASES;import static org.apache.solr.client.api.model.Constants.ONLY_IF_DOWN;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;import io.swagger.v3.oas.annotations.Operation;import javax.ws.rs.DELETE;import javax.ws.rs.PUT;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import javax.ws.rs.QueryParam;import org.apache.solr.client.api.model.ScaleCollectionRequestBody;import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;@@ -46,7 +44,6 @@ public interface DeleteReplicaApi {@DELETE@Path("/shards/{shardName}/replicas/{replicaName}")- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete an single replica by name",tags = {"replicas"})@@ -65,7 +62,6 @@ public interface DeleteReplicaApi {@DELETE@Path("/shards/{shardName}/replicas")- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete one or more replicas from the specified collection and shard",tags = {"replicas"})@@ -84,7 +80,6 @@ public interface DeleteReplicaApi {@PUT@Path("/scale")- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Scale the replica count for all shards in the specified collection",tags = {"replicas"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaPropertyApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaPropertyApi.javaindex 15d98564ffe..8e8f52fd33a 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaPropertyApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteReplicaPropertyApi.java@@ -17,14 +17,11 @@package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import javax.ws.rs.DELETE;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import org.apache.solr.client.api.model.SolrJerseyResponse;/**@@ -36,7 +33,6 @@ import org.apache.solr.client.api.model.SolrJerseyResponse;public interface DeleteReplicaPropertyApi {@DELETE- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "Delete an existing replica property",tags = {"replica-properties"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListAliasesApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListAliasesApi.javaindex eaeddf7bd2a..3f786b9d5e7 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListAliasesApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListAliasesApi.java@@ -16,15 +16,11 @@*/package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import io.swagger.v3.oas.annotations.Parameter;import javax.ws.rs.GET;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;-import javax.ws.rs.core.MediaType;import org.apache.solr.client.api.model.GetAliasByNameResponse;import org.apache.solr.client.api.model.ListAliasesResponse;@@ -33,7 +29,6 @@ import org.apache.solr.client.api.model.ListAliasesResponse;public interface ListAliasesApi {@GET- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "List the existing collection aliases.",tags = {"aliases"})@@ -41,7 +36,6 @@ public interface ListAliasesApi {@GET@Path("/{aliasName}")- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Get details for a specific collection alias.",tags = {"aliases"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionBackupsApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionBackupsApi.javaindex 24701fb18cc..59657085b95 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionBackupsApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionBackupsApi.java@@ -18,14 +18,12 @@ package org.apache.solr.client.api.endpoint;import static org.apache.solr.client.api.model.Constants.BACKUP_LOCATION;import static org.apache.solr.client.api.model.Constants.BACKUP_REPOSITORY;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;import io.swagger.v3.oas.annotations.Operation;import java.io.IOException;import javax.ws.rs.GET;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;import javax.ws.rs.QueryParam;import org.apache.solr.client.api.model.ListCollectionBackupsResponse;@@ -34,7 +32,6 @@ import org.apache.solr.client.api.model.ListCollectionBackupsResponse;public interface ListCollectionBackupsApi {@GET- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "List existing incremental backups at the specified location.",tags = {"collection-backups"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionsApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionsApi.javaindex fabb670a4b5..bb8baa210f3 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionsApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListCollectionsApi.java@@ -16,18 +16,14 @@*/package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import javax.ws.rs.GET;import javax.ws.rs.Path;-import javax.ws.rs.Produces;import org.apache.solr.client.api.model.ListCollectionsResponse;@Path("/collections")public interface ListCollectionsApi {@GET- @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})@Operation(summary = "List all collections in this Solr cluster",tags = {"collections"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListConfigsetsApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListConfigsetsApi.javaindex c1e99b805a1..b00a47cac19 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ListConfigsetsApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ListConfigsetsApi.java@@ -19,14 +19,12 @@ package org.apache.solr.client.api.endpoint;import io.swagger.v3.oas.annotations.Operation;import javax.ws.rs.GET;import javax.ws.rs.Path;-import javax.ws.rs.Produces;import org.apache.solr.client.api.model.ListConfigsetsResponse;/** V2 API definition for listing configsets. */@Path("/cluster/configs")public interface ListConfigsetsApi {@GET- @Produces({"application/json", "application/javabin"})@Operation(summary = "List the configsets available to Solr.",tags = {"configsets"})diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ReloadCollectionApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ReloadCollectionApi.javaindex 39f27d2911d..2bf85b90626 100644--- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ReloadCollectionApi.java+++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ReloadCollectionApi.java@@ -16,14 +16,10 @@*/package org.apache.solr.client.api.endpoint;-import static org.apache.solr.client.api.util.Constants.BINARY_CONTENT_TYPE_V2;-import io.swagger.v3.oas.annotations.Operation;import javax.ws.rs.POST;import javax.ws.rs.Path;import javax.ws.rs.PathParam;-import javax.ws.rs.Produces;-import javax.ws.rs.core.MediaType;import org.apache.solr.client.api.model.ReloadCollectionRequestBody;import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;@@ -31,7 +27,6 @@ import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;@Path("/collections/{collectionName}/reload")public interface ReloadCollectionApi {@POST- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})@Operation(summary = "Reload all cores in the specified collection.",tags = {"collections"})diff --git a/solr/core/src/test/org/apache/solr/handler/configsets/ListConfigSetsAPITest.java b/solr/core/src/test/org/apache/solr/handler/configsets/ListConfigSetsAPITest.javaindex 635dc8305e5..a0cf41622cd 100644--- a/solr/core/src/test/org/apache/solr/handler/configsets/ListConfigSetsAPITest.java+++ b/solr/core/src/test/org/apache/solr/handler/configsets/ListConfigSetsAPITest.java@@ -91,7 +91,7 @@ public class ListConfigSetsAPITest extends JerseyTest {when(mockCoreContainer.getConfigSetService()).thenReturn(configSetService);when(configSetService.listConfigs()).thenReturn(List.of("cs1", "cs2"));- final Response response = target("/cluster/configs").request().get();+ final Response response = target("/cluster/configs").request("application/json").get();final String jsonBody = response.readEntity(String.class);assertEquals(200, response.getStatus());@@ -108,7 +108,8 @@ public class ListConfigSetsAPITest extends JerseyTest {when(mockCoreContainer.getConfigSetService()).thenReturn(configSetService);when(configSetService.listConfigs()).thenReturn(List.of("cs1", "cs2"));- final var response = target("/cluster/configs").request().get(ListConfigsetsResponse.class);+ final var response =+ target("/cluster/configs").request("application/json").get(ListConfigsetsResponse.class);assertNotNull(response.configSets);assertNull(response.error);@@ -132,7 +133,8 @@ public class ListConfigSetsAPITest extends JerseyTest {when(mockCoreContainer.getConfigSetService()).thenReturn(configSetService);when(configSetService.listConfigs()).thenReturn(List.of("cs1", "cs2"));- final var response = target("/cluster/configs").request().get(ListConfigsetsResponse.class);+ final var response =+ target("/cluster/configs").request("application/json").get(ListConfigsetsResponse.class);final NamedList<Object> squashedResponse = new NamedList<>();V2ApiUtils.squashIntoNamedList(squashedResponse, response);final ConfigSetAdminResponse.List solrjResponse = new ConfigSetAdminResponse.List();