-
Notifications
You must be signed in to change notification settings - Fork 9
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
Aggregating ITypeShapeProvider #91
Comments
Here's the relevant concept in STJ: https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.metadata.jsontypeinforesolver.combine?view=net-9.0 |
AArnott
added a commit
to AArnott/PolyType
that referenced
this issue
Jan 26, 2025
AArnott
added a commit
to AArnott/PolyType
that referenced
this issue
Jan 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider an
ITypeShapeProvider
implementation that aggregates results from a list of otherITypeShapeProvider
instances.This aggregator would take a list of other instances and return the first shape from the list of providers that returns a non-null result.
It may include caching of the result for faster repeat calls.
This would enable combining multiple shape providers and querying them in a unified manner.
The scenario I'm thinking about is of an RPC system that may have access to several source generated
ITypeShapeProvider
instances, and may also want to fallback to the reflection-basedITypeShapeProvider
when no source generated one is known.Example usage
The text was updated successfully, but these errors were encountered: