Skip to content

Default serialization options cannot be modified #388

@DiscoPYF

Description

@DiscoPYF

The readme says that the default serialization options can be modified like so:

var serializer = new JsonNetApiClientSerialization();
serializer.DefaultOptions.IgnoreNullValues = false;

This doesn't work at the moment because ApiClientSerialization.DefaultOptions always returns a new instance of ApiClientSerializationOptions:

public virtual ApiClientSerializationOptions DefaultOptions => 
            new ApiClientSerializationOptions(false, true, false);

We should use assign the value instead of returning it:

public virtual ApiClientSerializationOptions DefaultOptions { get; } = 
            new ApiClientSerializationOptions(false, true, false);

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions