epugh commented on code in PR #4203:
URL: https://github.com/apache/solr/pull/4203#discussion_r3448612074
##########
solr/core/src/java/org/apache/solr/handler/designer/SchemaDesigner.java:
##########
@@ -1291,41 +1340,41 @@ protected String checkMutable(String configSet,
SolrQueryRequest req) throws IOE
final int schemaVersionInZk =
configSetHelper.getCurrentSchemaVersion(mutableId);
if (schemaVersionInZk != -1) {
// check the versions agree
- configSetHelper.checkSchemaVersion(
- mutableId, requireSchemaVersionFromClient(req), schemaVersionInZk);
+ configSetHelper.checkSchemaVersion(mutableId, clientSchemaVersion,
schemaVersionInZk);
} // else the stored is -1, can't really enforce here
return mutableId;
}
- protected int requireSchemaVersionFromClient(SolrQueryRequest req) {
- final int schemaVersion = req.getParams().getInt(SCHEMA_VERSION_PARAM, -1);
- if (schemaVersion == -1) {
+ protected void requireSchemaVersion(Integer schemaVersion) {
+ if (schemaVersion == null) {
throw new SolrException(
- SolrException.ErrorCode.BAD_REQUEST,
- SCHEMA_VERSION_PARAM + " is a required parameter for the " +
req.getPath() + " endpoint");
+ SolrException.ErrorCode.BAD_REQUEST, SCHEMA_VERSION_PARAM + " is a
required parameter!");
}
- return schemaVersion;
}
Review Comment:
dealt with!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]