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

.Net: New Feature: There should be a way to specify the json sterilization options that are used by default just like MVC or signalR #10060

Open
SteveStrong opened this issue Jan 5, 2025 · 2 comments
Assignees
Labels
.NET Issue or Pull requests regarding .NET code

Comments

@SteveStrong
Copy link


name: Feature request Standardize json serilization options across asp.net
about: Suggest an idea for this project Semantic Kernal


the code should look like then when building Semantic Kernel

    // Create a kernel with Azure OpenAI chat completion

    var builder = Kernel.CreateBuilder()
        .AddAzureOpenAIChatCompletion(modelId, endpoint, apiKey);

    builder.Services.AddJsonOptions(options =>
    {
        var ser = options.JsonSerializerOptions;
        ser.IgnoreReadOnlyFields = true;
        ser.IncludeFields = true;
        ser.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
        ser.WriteIndented = true;
    });
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Jan 5, 2025
@github-actions github-actions bot changed the title New Feature: There should be a way to specify the json sterilization options that are used by default just like MVC or signalR .Net: New Feature: There should be a way to specify the json sterilization options that are used by default just like MVC or signalR Jan 5, 2025
@SteveStrong
Copy link
Author

this would make it easy to filter out non-serialize objects that are part of the class, mainly Actions that are fields or properties, this is very useful for tools that create objects

@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 8, 2025

@SteveStrong we don't think one JsonSerializerOptions will work for all scenarios in SK now and into the future. Can you provide some details on the problem you are facing and we can think about how to help you solve this. A snippet of code showing the problematic scenario would be ideal.

@markwallace-microsoft markwallace-microsoft moved this from Sprint: In Progress to Sprint: Planned in Semantic Kernel Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: Planned
Development

No branches or pull requests

3 participants