Update filter to use json package interfaces.

This commit is contained in:
Jay
2026-05-08 09:54:31 -04:00
parent 047fc9d9a1
commit 60c8e8256b
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ func WithExtension(l string, e json.RawMessage) FilterOption {
// MarshalJSON converts the filter to JSON with standard fields, tag filters
// (prefixed with "#"), and extensions merged into a single object.
func MarshalJSON(f Filter) ([]byte, error) {
func (f Filter) MarshalJSON() ([]byte, error) {
outputMap := make(map[string]interface{})
// Add standard fields
@@ -168,7 +168,7 @@ func MarshalJSON(f Filter) ([]byte, error) {
// UnmarshalJSON parses JSON into the filter, separating standard fields,
// tag filters (keys starting with "#"), and extensions.
func UnmarshalJSON(data []byte, f *Filter) error {
func (f *Filter) UnmarshalJSON(data []byte) error {
// Decode into raw map
raw := make(FilterExtensions)
if err := json.Unmarshal(data, &raw); err != nil {