Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skeleton query validation endpoint #2595

Merged
merged 7 commits into from
Nov 1, 2024
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}/validateQuery")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets just use /{logicName}/validate to be consistent with the create, next, close calls

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name is fine however.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@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
Loading