-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from TheJacksonLaboratory/bugfix/queries
Bugfix/queries
- Loading branch information
Showing
11 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
@OpenAPIDefinition( | ||
info = @Info( | ||
title = "ontology-annotation-network", | ||
version = "1.0.7", | ||
version = "1.0.9", | ||
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") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
oan-rest/src/main/java/org/jax/oan/utils/QueryCleaner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.jax.oan.utils; | ||
|
||
public class QueryCleaner { | ||
|
||
/** | ||
* This method cleans the query string from any special characters | ||
* @param query the query string | ||
* @return the cleaned query string | ||
*/ | ||
public static String clean(String query) { | ||
return query.replaceAll("[^a-zA-Z0-9\\-:\\s]", ""); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
oan-rest/src/test/java/org/jax/oan/utils/QueryCleanerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jax.oan.utils; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class QueryCleanerTest { | ||
|
||
@Test | ||
void clean() { | ||
String query = "HP:0000001"; | ||
String badQuery = "HP:0000001!)"; | ||
assertEquals("HP:0000001", QueryCleaner.clean(query)); | ||
assertEquals("HP:0000001", QueryCleaner.clean(badQuery)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters