Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add small fix to Client.Class.liquid #3350

Closed
wants to merge 1 commit into from

Conversation

unchase
Copy link
Contributor

@unchase unchase commented Mar 9, 2021

No description provided.

@unchase
Copy link
Contributor Author

unchase commented Mar 9, 2021

@RicoSuter ready for review

@jeremyVignelles
Copy link
Collaborator

What is this supposed to do, in which case?

@unchase
Copy link
Contributor Author

unchase commented Mar 9, 2021

@jeremyVignelles when we using System.Text.Json with settings like this:

image

NSwag Studio generates:

private System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
{
    var settings = new System.Text.Json.JsonSerializerOptions(); var converters = new System.Text.Json.Serialization.JsonConverter[] { new Converter1() };
    foreach(var converter in converters)
        settings.Converters.Add(converter);
    UpdateJsonSerializerSettings(settings);
    return settings;
}

After this fix:

private System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
{
    var settings = new System.Text.Json.JsonSerializerOptions(); 
    var converters = new System.Text.Json.Serialization.JsonConverter[] { new Converter1() };
    foreach(var converter in converters)
        settings.Converters.Add(converter);
    UpdateJsonSerializerSettings(settings);
    return settings;
}

@RicoSuter
Copy link
Owner

Related: RicoSuter/NJsonSchema#1339

@unchase
Copy link
Contributor Author

unchase commented Mar 9, 2021

Related: #3351

@unchase unchase closed this Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants