Skip to content

Support System.Text.Json source generator contexts #10

@TheJayMann

Description

@TheJayMann

With System.Text.Json adding a source generator to version 6, it would be nice if this could generate HttpClient code which could use the generated JsonSerializerContext and JsonTypeInfo<> types. I'm not entirely sure the best ways to add this, but I think some ways to do this would be to allow an option to accept JsonSerializerContext as a constructor argument, allow the method to accept an IObjectSerializer which can perform the serialization itself, allow returning the HttpContent directly, or allow the method to take in a JsonSerializerContext or a JsonTypeInfo<TRequest> and JsonTypeInfo<TResult>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions