Skip to content

(SignalR): Support custom output formatter #55546

@angelaki

Description

@angelaki

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I want to be able to have more control over object serialization. Using MVC I'm able to serialize only interface properties / support polymorphism etc. using a custom output formatter. SignalR passes the value (as object, not generic so even the type info gets lost) to a JsonSerializeObject method so no chance for a clean solution here.

Describe the solution you'd like

It would be nice if some kind of "output / input formatter" (analogous MVC) could be set. It sure behaves a bit different here, since there is no defined encoding (like HTTP has) but still an input / output-formatter would be great. Maybe not a list but just a single instance (with your one as default fallback).

Additional context

Btw.: your JsonHubProtocolOptions has still setable PayloadSerializerOptions. Guess that should be marked readonly (#27727).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityarea-signalrIncludes: SignalR clients and servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions