Skip to content

Commit

Permalink
Add skeleton query validation endpoint (#2595)
Browse files Browse the repository at this point in the history
* Add a skeleton implementation of a query validation endpoint to allow external clients to begin implementation.

Part of work for #2585
  • Loading branch information
lbschanno authored Nov 1, 2024
1 parent dfbbb41 commit 9b5935f
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2997,6 +2997,26 @@ private void updateQueryParams(Query q, String queryLogicName, String query, Dat
}
}

/**
* @param queryLogicName
* the logic name
* @param queryParameters
* the query parameters
* @return the generic response
*/
@POST
@Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf",
"application/x-protostuff"})
@Path("/{logicName}/validate")
@Interceptors({RequiredInterceptor.class, ResponseInterceptor.class})
@Timed(name = "dw.query.validateQuery", absolute = true)
public GenericResponse<String> validateQuery(@Required("logicName") @PathParam("logicName") String queryLogicName,
MultivaluedMap<String,String> queryParameters) {
GenericResponse<String> response = new GenericResponse<>();
response.setMessages(Collections.singletonList("Query validator coming soon."));
throw new DatawaveWebApplicationException(new UnsupportedOperationException("Query validator not implemented"), response, 501);
}

/**
* <strong>Administrator credentials required.</strong> Returns list of queries for some other user
*
Expand Down

0 comments on commit 9b5935f

Please sign in to comment.