Skip to content

Commit

Permalink
marshal URLs using jsonutil
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkRosemaker committed Dec 24, 2024
1 parent d47e3d8 commit 91bac37
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 147 deletions.
5 changes: 3 additions & 2 deletions internal/json/opts.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package json

import (
"github.com/MarkRosemaker/jsonutil"
"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
)
Expand All @@ -9,7 +10,7 @@ var Options = json.JoinOptions([]json.Options{
// unevaluatedProperties is set to false in most objects according to the OpenAPI specification
// also protect against deleting unknown fields when overwriting later
json.RejectUnknownMembers(true),
json.WithMarshalers(URLMarshal),
json.WithUnmarshalers(URLUnmarshal),
json.WithMarshalers(json.NewMarshalers(json.MarshalFuncV2(jsonutil.URLMarshal))),
json.WithUnmarshalers(json.NewUnmarshalers(json.UnmarshalFuncV2(jsonutil.URLUnmarshal))),
jsontext.WithIndent(" "), // indent with two spaces
}...)
40 changes: 0 additions & 40 deletions internal/json/url.go

This file was deleted.

105 changes: 0 additions & 105 deletions internal/json/url_test.go

This file was deleted.

0 comments on commit 91bac37

Please sign in to comment.