mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2025-12-29 07:44:25 +00:00
Make sure to enable Clean JSON when select fields given
This commit is contained in:
@@ -199,6 +199,9 @@ func (h *Handler) parseSelectFields(options *ExtendedRequestOptions, value strin
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
options.Columns = h.parseCommaSeparated(value)
|
options.Columns = h.parseCommaSeparated(value)
|
||||||
|
if len(options.Columns) > 1 {
|
||||||
|
options.CleanJSON = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseNotSelectFields parses x-not-select-fields header
|
// parseNotSelectFields parses x-not-select-fields header
|
||||||
@@ -207,6 +210,9 @@ func (h *Handler) parseNotSelectFields(options *ExtendedRequestOptions, value st
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
options.OmitColumns = h.parseCommaSeparated(value)
|
options.OmitColumns = h.parseCommaSeparated(value)
|
||||||
|
if len(options.OmitColumns) > 1 {
|
||||||
|
options.CleanJSON = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseFieldFilter parses x-fieldfilter-{colname} header (exact match)
|
// parseFieldFilter parses x-fieldfilter-{colname} header (exact match)
|
||||||
|
|||||||
Reference in New Issue
Block a user