From 0c689f9f6f76cbef97095f743b36c92fa1288897 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 21 May 2014 15:19:52 +1000 Subject: [PATCH] version is mandatory too --- .../rest/services/DefaultSearchService.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java index b923e37c7..62d0df2d3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java @@ -245,6 +245,30 @@ public class DefaultSearchService } ).build(); } + if ( StringUtils.isEmpty( version ) ) + { + return Response.status( new Response.StatusType() + { + @Override + public int getStatusCode() + { + return Response.Status.BAD_REQUEST.getStatusCode(); + } + + @Override + public Response.Status.Family getFamily() + { + return Response.Status.BAD_REQUEST.getFamily(); + } + + @Override + public String getReasonPhrase() + { + return "version mandatory"; + } + } ).build(); + } + if ( StringUtils.isEmpty( artifactId ) ) { return Response.status( new Response.StatusType() -- 2.39.5