Skip to content

Add field warning to SearchResponse #4

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions src/main/java/com/manticoresearch/client/model/SearchResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,12 @@
package com.manticoresearch.client.model;

import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.manticoresearch.client.model.SearchResponseHits;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.manticoresearch.client.JSON;


/**
* Response object of a search request
Expand All @@ -36,7 +25,8 @@
SearchResponse.JSON_PROPERTY_TIMED_OUT,
SearchResponse.JSON_PROPERTY_AGGREGATIONS,
SearchResponse.JSON_PROPERTY_HITS,
SearchResponse.JSON_PROPERTY_PROFILE
SearchResponse.JSON_PROPERTY_PROFILE,
SearchResponse.JSON_PROPERTY_WARNING
})

public class SearchResponse {
Expand All @@ -54,7 +44,9 @@ public class SearchResponse {

public static final String JSON_PROPERTY_PROFILE = "profile";
private Object profile;


public static final String JSON_PROPERTY_WARNING = "warning";
private Map<String, Object> warning;

public SearchResponse took(Integer took) {
this.took = took;
Expand Down Expand Up @@ -174,8 +166,24 @@ public Object getProfile() {
public void setProfile(Object profile) {
this.profile = profile;
}

/**
* Get warning
* @return warning
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_WARNING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, Object> getWarning() {
return warning;
}

public void setWarning(Map<String, Object> warning) {
this.warning = warning;
}

/**
* Return true if this searchResponse object is equal to o.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,12 @@ public void profileTest() {
// TODO: test profile
}

/**
* Test the property 'warning'
*/
@Test
public void warningTest() {
// TODO: test warning
}

}