From 7a0ab5f66f0a2ea9f7b2b204eaf9ff3cf246f1d9 Mon Sep 17 00:00:00 2001 From: Gregory Rushton Date: Tue, 23 Jun 2026 10:12:28 -0400 Subject: [PATCH 1/2] feat: remove unused schema api, docs, and tests --- .../consent/http/ConsentApplication.java | 2 -- .../http/resources/SchemaResource.java | 28 ------------------- src/main/resources/assets/api-docs.yaml | 2 -- .../paths/schemaDatasetRegistrationV1.yaml | 14 ---------- .../http/resources/SchemaResourceTest.java | 27 ------------------ 5 files changed, 73 deletions(-) delete mode 100644 src/main/java/org/broadinstitute/consent/http/resources/SchemaResource.java delete mode 100644 src/main/resources/assets/paths/schemaDatasetRegistrationV1.yaml delete mode 100644 src/test/java/org/broadinstitute/consent/http/resources/SchemaResourceTest.java diff --git a/src/main/java/org/broadinstitute/consent/http/ConsentApplication.java b/src/main/java/org/broadinstitute/consent/http/ConsentApplication.java index e394d3e0c..bdfa22b82 100644 --- a/src/main/java/org/broadinstitute/consent/http/ConsentApplication.java +++ b/src/main/java/org/broadinstitute/consent/http/ConsentApplication.java @@ -72,7 +72,6 @@ import org.broadinstitute.consent.http.resources.PassportResource; import org.broadinstitute.consent.http.resources.PublicFeatureFlagResource; import org.broadinstitute.consent.http.resources.SamResource; -import org.broadinstitute.consent.http.resources.SchemaResource; import org.broadinstitute.consent.http.resources.StatusResource; import org.broadinstitute.consent.http.resources.StudyResource; import org.broadinstitute.consent.http.resources.SupportResource; @@ -181,7 +180,6 @@ public void run(ConsentConfiguration config, Environment env) { env.jersey().register(injector.getInstance(OntologyResource.class)); env.jersey().register(injector.getInstance(PassportResource.class)); env.jersey().register(injector.getInstance(SamResource.class)); - env.jersey().register(injector.getInstance(SchemaResource.class)); env.jersey().register(injector.getInstance(SwaggerResource.class)); env.jersey().register(injector.getInstance(StatusResource.class)); env.jersey().register(injector.getInstance(StudyResource.class)); diff --git a/src/main/java/org/broadinstitute/consent/http/resources/SchemaResource.java b/src/main/java/org/broadinstitute/consent/http/resources/SchemaResource.java deleted file mode 100644 index a09fd4681..000000000 --- a/src/main/java/org/broadinstitute/consent/http/resources/SchemaResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.broadinstitute.consent.http.resources; - -import com.google.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import org.broadinstitute.consent.http.util.JsonSchemaUtil; - -@Path("/schemas") -public class SchemaResource extends Resource { - - private final JsonSchemaUtil jsonSchemaUtil; - - @Inject - public SchemaResource(JsonSchemaUtil jsonSchemaUtil) { - this.jsonSchemaUtil = jsonSchemaUtil; - } - - @GET - @Path("/dataset-registration/v1") - @Produces(MediaType.APPLICATION_JSON) - public Response getDatasetRegistrationSchemaV1() { - String content = jsonSchemaUtil.getDatasetRegistrationSchemaV1(); - return Response.ok().entity(content).type(MediaType.APPLICATION_JSON).build(); - } -} diff --git a/src/main/resources/assets/api-docs.yaml b/src/main/resources/assets/api-docs.yaml index 19b361144..e47ad8790 100644 --- a/src/main/resources/assets/api-docs.yaml +++ b/src/main/resources/assets/api-docs.yaml @@ -957,8 +957,6 @@ paths: $ref: './paths/ontologySearch.yaml' /ontology/autocomplete: $ref: './paths/ontologyAutocomplete.yaml' - /schemas/dataset-registration/v1: - $ref: './paths/schemaDatasetRegistrationV1.yaml' /status: get: summary: System Health Status diff --git a/src/main/resources/assets/paths/schemaDatasetRegistrationV1.yaml b/src/main/resources/assets/paths/schemaDatasetRegistrationV1.yaml deleted file mode 100644 index 0148adf99..000000000 --- a/src/main/resources/assets/paths/schemaDatasetRegistrationV1.yaml +++ /dev/null @@ -1,14 +0,0 @@ -get: - summary: Dataset Registration Schema V1 - deprecated: true - description: Dataset Registration Schema V1 - operationId: schemasDatasetRegistrationV1Get - tags: - - Schema - responses: - 200: - description: Dataset Registration Schema V1 - content: - application/json: - schema: - $ref: '../schemas/DatasetRegistrationSchemaV1.yaml' diff --git a/src/test/java/org/broadinstitute/consent/http/resources/SchemaResourceTest.java b/src/test/java/org/broadinstitute/consent/http/resources/SchemaResourceTest.java deleted file mode 100644 index 05b23a3b5..000000000 --- a/src/test/java/org/broadinstitute/consent/http/resources/SchemaResourceTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.broadinstitute.consent.http.resources; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import com.google.api.client.http.HttpStatusCodes; -import jakarta.ws.rs.core.Response; -import org.broadinstitute.consent.http.util.JsonSchemaUtil; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -@ExtendWith(MockitoExtension.class) -class SchemaResourceTest { - - private final JsonSchemaUtil jsonSchemaUtil = new JsonSchemaUtil(); - - @Test - void testGetDatasetRegistrationSchemaV1() { - SchemaResource resource = new SchemaResource(jsonSchemaUtil); - - Response response = resource.getDatasetRegistrationSchemaV1(); - assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus()); - - Object body = response.getEntity(); - assertEquals(jsonSchemaUtil.getDatasetRegistrationSchemaV1(), body.toString()); - } -} From 1d117f873064f8c609923e03022ddc2c3f1efae1 Mon Sep 17 00:00:00 2001 From: Gregory Rushton Date: Tue, 23 Jun 2026 11:42:13 -0400 Subject: [PATCH 2/2] doc: update description for patch dataset by id --- src/main/resources/assets/paths/datasetById.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/assets/paths/datasetById.yaml b/src/main/resources/assets/paths/datasetById.yaml index a91880592..77af82be4 100644 --- a/src/main/resources/assets/paths/datasetById.yaml +++ b/src/main/resources/assets/paths/datasetById.yaml @@ -3,17 +3,17 @@ patch: operationId: apiDatasetIdPatch description: | This API allows Admins, Chairpersons, and Data Submitters to patch the dataset name and a - limited set of dataset properties. Data Location must conform to the schema defined in - [/schemas/dataset-registration/v1](#/Schema/getDatasetRegistrationSchemaV1) + limited set of dataset properties. * The dataset name. This is an optional field * List of optional properties to update * \# of participants must be an integer value greater than zero * URL must be a valid url * Data Location must be a valid data location: - * AnVIL Workspace - * Terra Workspace - * TDR Location - * Not Determined + - AnVIL Workspace + - Terra Workspace + - TDR Location + - Not Determined + - Other parameters: - name: id in: path