Skip to content

Commit

Permalink
Merge branch 'master' into bearer-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrdoherty committed Feb 5, 2024
2 parents ffff175 + 8d29e95 commit ac484d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Model/src/main/java/org/gusdb/wdk/core/api/JsonKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class JsonKeys {
public static final String IS_REMOVABLE = "isRemovable";
public static final String IS_REQUIRED = "isRequired";
public static final String IS_MULTILINE = "isMultiLine";
public static final String IS_NUMBER = "isNumber";
public static final String IS_PUBLIC = "isPublic";
public static final String USE_BASKET = "useBasket";
public static final String SCOPES = "scopes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public class StringParamFormatter extends ParamFormatter<StringParam> {

@Override
public <S extends ParameterContainerInstanceSpec<S>> JSONObject getJson(DisplayablyValid<S> spec) throws WdkModelException {
return getBaseJson(spec).put(JsonKeys.LENGTH, _param.getLength());
return getBaseJson(spec)
.put(JsonKeys.LENGTH, _param.getLength())
.put(JsonKeys.IS_MULTILINE, _param.getMultiLine())
.put(JsonKeys.IS_NUMBER, _param.isNumber());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ static AnswerRequest parseAnswerRequest(Question question,
String reporterName, JSONObject requestBody, WdkModel wdkModel, User sessionUser, boolean avoidCacheHit)
throws RequestMisformatException, DataValidationException, WdkModelException {

if (requestBody == null || !requestBody.has(JsonKeys.SEARCH_CONFIG) || !requestBody.has(JsonKeys.REPORT_CONFIG)) {
throw new RequestMisformatException("Request body must not be null and must contain '" +
JsonKeys.SEARCH_CONFIG + "' and '" + JsonKeys.REPORT_CONFIG + "' properties.");
}

// parse view filters
FilterOptionListBuilder viewFilters = AnswerSpecServiceFormat.parseViewFilters(requestBody);

Expand Down

0 comments on commit ac484d9

Please sign in to comment.