Skip to content

Commit

Permalink
Merge pull request #47 from TheJacksonLaboratory/enhancement/restrict…
Browse files Browse the repository at this point in the history
…-query-size

Enhancement/restrict query size
  • Loading branch information
iimpulse authored Feb 7, 2025
2 parents 4468eb8 + fb8d775 commit 4a38aa1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion oan-etl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jax.oan</groupId>
<artifactId>ontology-annotation-network</artifactId>
<version>1.0.12</version>
<version>1.0.13</version>
</parent>

<artifactId>oan-etl</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion oan-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jax.oan</groupId>
<artifactId>ontology-annotation-network</artifactId>
<version>1.0.12</version>
<version>1.0.13</version>
</parent>

<artifactId>oan-model</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion oan-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jax.oan</groupId>
<artifactId>ontology-annotation-network</artifactId>
<version>1.0.12</version>
<version>1.0.13</version>
</parent>

<artifactId>oan-rest</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion oan-rest/src/main/java/org/jax/oan/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@OpenAPIDefinition(
info = @Info(
title = "ontology-annotation-network",
version = "1.0.12",
version = "1.0.13",
description = "A restful service for access to the ontology annotation network.",
contact = @Contact(name = "Michael Gargano", email = "[email protected]")
), servers = {@Server(url = "https://ontology.jax.org/api/network", description = "Production Server URL")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.micronaut.http.exceptions.HttpStatusException;
import io.micronaut.serde.annotation.SerdeImport;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import org.jax.oan.core.Disease;
import org.jax.oan.core.SearchDto;
import org.jax.oan.core.SupportedEntity;
Expand Down Expand Up @@ -38,7 +39,7 @@ public SearchController(SearchService searchService, DiseaseService diseaseServi
public HttpResponse<?> searchEntity(@Schema(minLength = 1, maxLength = 20, type = "string", pattern = ".*", format = "string")
@PathVariable String entity,
@Schema(minLength = 1, maxLength = 255, type = "string", pattern = "^[a-zA-Z0-9\\s\\-':]+$", format = "string")
@QueryValue @Pattern(regexp = "^[a-zA-Z0-9\\s\\-':,]+$") String q,
@QueryValue @Pattern(regexp = "^[a-zA-Z0-9\\s\\-':,]+$") @Size(max = 255) String q,
@Schema(minLength = 0, maxLength = 1000, type = "number", format = "int32")
@QueryValue(value = "page", defaultValue = "0") int page,
@Schema(minLength = 0, maxLength = 10000, type = "number", format = "int32")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ void negative_search_bad_query(RequestSpecification spec){
spec.when().get("/api/network/search/disease?q=( )").then().statusCode(400);
spec.when().get("/api/network/search/disease?q=%20Cardiac%20tumors%20(").then().statusCode(400);
spec.when().get("/api/network/search/disease?q=NM_000314.8:c.-511G%3EA").then().statusCode(400);
spec.when().get("/api/network/search/disease?q=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789").then().statusCode(400);
}


@Test
void postive_intersecting(RequestSpecification spec){
when(diseaseService.findIntersectingByPhenotypes(List.of(TermId.of("HP:333333"), TermId.of("HP:44444"))))
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.jax.oan</groupId>
<artifactId>ontology-annotation-network</artifactId>
<packaging>pom</packaging>
<version>1.0.12</version>
<version>1.0.13</version>

<name>ontology-annotation-network</name>
<url>https://github.com/TheJacksonLaboratory/ontology-annotation-network</url>
Expand All @@ -27,7 +27,7 @@
<neo4j.version>5.13.0</neo4j.version>
<swagger.version>2.2.20</swagger.version>
<picocli.version>4.7.5</picocli.version>
<logback.version>1.4.11</logback.version>
<logback.version>1.4.12</logback.version>
</properties>

<modules>
Expand Down

0 comments on commit 4a38aa1

Please sign in to comment.