Fixed getMandatory
This commit is contained in:
parent
ebeba09151
commit
8b92208774
|
@ -41,11 +41,7 @@ public class BaseRequest {
|
|||
|
||||
public static final String getMandatory(String param,Document params) throws InvalidPluginRequestException {
|
||||
if(params==null || params.isEmpty()|| !params.containsKey(param)) throw new InvalidPluginRequestException("Missing mandatory parameter "+param);
|
||||
try {
|
||||
return Serialization.write(params.get(param));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new InvalidPluginRequestException(e);
|
||||
}
|
||||
return Serialization.convert(params.get(param),String.class);
|
||||
}
|
||||
|
||||
public BaseRequest validate() throws InvalidPluginRequestException {
|
||||
|
|
Loading…
Reference in New Issue