mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 20:07:51 +00:00
index param is required for /fragment/nodes
This commit is contained in:
parent
1764d5a9bf
commit
cc521e5c91
2 changed files with 8 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ func BuildRouters(handler *Handler) {
|
|||
|
||||
func (h *Handler) populateValidators() {
|
||||
h.validators = map[string]*queryValidationSpec{}
|
||||
h.validators["GetFragmentNodes"] = QueryValidationSpecRequired("slice").Optional("index")
|
||||
h.validators["GetFragmentNodes"] = QueryValidationSpecRequired("slice", "index")
|
||||
h.validators["GetSliceMax"] = QueryValidationSpecRequired().Optional("inverse")
|
||||
h.validators["PostQuery"] = QueryValidationSpecRequired().Optional("slices", "columnAttrs", "excludeAttrs", "excludeBits")
|
||||
h.validators["GetExport"] = QueryValidationSpecRequired("index", "frame", "view", "slice")
|
||||
|
|
|
|||
|
|
@ -1225,6 +1225,13 @@ func TestHandler_Fragment_Nodes(t *testing.T) {
|
|||
t.Fatalf("unexpected status code: %d", w.Code)
|
||||
}
|
||||
|
||||
// index is required
|
||||
w = httptest.NewRecorder()
|
||||
r = test.MustNewHTTPRequest("GET", "/fragment/nodes?slice=0", nil)
|
||||
h.ServeHTTP(w, r)
|
||||
if w.Code != http.StatusBadRequest {
|
||||
t.Fatalf("unexpected status code: %d", w.Code)
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the handler can return expvars without panicking.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue