Skip to content

Commit 3a1ade9

Browse files
committed
Remove Marshaler completely
1 parent c6769eb commit 3a1ade9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Diff for: nexus/server.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func (h *httpHandler) getOperationInfo(writer http.ResponseWriter, request *http
335335
return
336336
}
337337

338-
bytes, err := h.options.Marshaler(info)
338+
bytes, err := json.Marshal(info)
339339
if err != nil {
340340
h.writeFailure(writer, fmt.Errorf("failed to marshal operation info: %w", err))
341341
return
@@ -376,9 +376,6 @@ type HandlerOptions struct {
376376
// A stuctured logger.
377377
// Defaults to slog.Default().
378378
Logger *slog.Logger
379-
// Optional marshaler for marshaling objects to JSON.
380-
// Defaults to json.Marshal.
381-
Marshaler func(any) ([]byte, error)
382379
// Max duration to allow waiting for a single get result request.
383380
// Enforced if provided for requests with the wait query parameter set.
384381
//
@@ -388,9 +385,6 @@ type HandlerOptions struct {
388385

389386
// NewHTTPHandler constructs an [http.Handler] from given options for handling Nexus service requests.
390387
func NewHTTPHandler(options HandlerOptions) http.Handler {
391-
if options.Marshaler == nil {
392-
options.Marshaler = json.Marshal
393-
}
394388
if options.Logger == nil {
395389
options.Logger = slog.Default()
396390
}

0 commit comments

Comments
 (0)