Fixed missing request entity.
Change-Id: I3e5fa2e91d5c627930e5a7d0bcbfed9497b91467
diff --git a/full/Changes b/full/Changes
index 05e07ff..13707b8 100644
--- a/full/Changes
+++ b/full/Changes
@@ -1,6 +1,10 @@
# version 0.64
2021-07-29
- Updated the change files and made a new version.
+2021-08-12
+- Fixed errors due to missing query type and added tests.
+2021-08-13
+- Fixed missing request entity.
# version 0.63.2
2021-06-11
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java b/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java
index 3d60f21..c8961934 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java
@@ -204,7 +204,7 @@
verifyUsername(username, queryCreator);
QueryDO query = queryDao.retrieveQueryByName(queryName, queryCreator);
- ParameterChecker.checkObjectValue(queryJson, "request entity");
+
if (query == null) {
storeQuery(queryJson, queryName, username);
return Status.CREATED;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
index 1b1fc8b..36ed830 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
@@ -28,6 +28,7 @@
import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
import de.ids_mannheim.korap.security.context.TokenContext;
import de.ids_mannheim.korap.service.QueryService;
+import de.ids_mannheim.korap.utils.ParameterChecker;
import de.ids_mannheim.korap.web.KustvaktResponseHandler;
import de.ids_mannheim.korap.web.filter.APIVersionFilter;
import de.ids_mannheim.korap.web.filter.AuthenticationFilter;
@@ -93,6 +94,7 @@
try {
scopeService.verifyScope(context, OAuth2Scope.EDIT_VC);
+ ParameterChecker.checkObjectValue(query, "request entity");
if (query.getQueryType() == null) {
query.setQueryType(QueryType.QUERY);
}
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
index 4b6a00d..9009560 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
@@ -31,6 +31,7 @@
import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
import de.ids_mannheim.korap.security.context.TokenContext;
import de.ids_mannheim.korap.service.QueryService;
+import de.ids_mannheim.korap.utils.ParameterChecker;
import de.ids_mannheim.korap.web.KustvaktResponseHandler;
import de.ids_mannheim.korap.web.filter.APIVersionFilter;
import de.ids_mannheim.korap.web.filter.AuthenticationFilter;
@@ -106,6 +107,7 @@
try {
scopeService.verifyScope(context, OAuth2Scope.EDIT_VC);
+ ParameterChecker.checkObjectValue(vc, "request entity");
if (vc.getQueryType() == null) {
vc.setQueryType(QueryType.VIRTUAL_CORPUS);
}