Fix JSON marshaling of backend options by using a pointer

This commit is contained in:
2025-10-19 18:27:22 +02:00
parent 9da2433a7c
commit 3500971f03

View File

@@ -163,7 +163,8 @@ func (c *Options) MarshalJSON() ([]byte, error) {
aux.BackendType = c.BackendOptions.BackendType aux.BackendType = c.BackendOptions.BackendType
// Marshal the backends.Options struct to get the properly formatted backend options // Marshal the backends.Options struct to get the properly formatted backend options
backendData, err := json.Marshal(c.BackendOptions) // Marshal a pointer to trigger the pointer receiver MarshalJSON method
backendData, err := json.Marshal(&c.BackendOptions)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to marshal backend options: %w", err) return nil, fmt.Errorf("failed to marshal backend options: %w", err)
} }