Make ResourceGraphBuilder extensible
See original GitHub issueIs your feature request related to a problem? Please describe. I need to make a resource type accessable through JADNC that is part of a third party lib. So I can’t add AttrAttribute to the properties of this type.
Describe the solution you’d like
It would be nice if it was possible to extend the ResourceGraphBuilder
. Maybe through JsonApiResourceDefinition
?
Sadly, the methods CreateResourceType
and GetAttributes
are private and sealed off.
Or did I miss another way to do this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Add custom data to resources using extensions
In this article, we'll discuss how Microsoft Graph supports extending its resources, the options available to add custom properties and when to ...
Read more >The Resource Graph
The ResourceGraph is a map of all the JSON:API resources and their relationships that your API serves. It is built at app startup...
Read more >Make Bicep extensibility production ready (phase I) #6864
Creating the issue to track the tasks for making Bicep extensibility production ready. Plan Items. Legend of annotations: Mark, Description.
Read more >How Threat Graph Leverages DSL to Improve Data ...
In our earlier post, Making Threat Graph Extensible: Leveraging a DSL to Improve Data Ingestion (Part 1 of 2), we explored how and...
Read more >Requirements for an extensible object-oriented tree/graph ...
Software engineers use graphs to represent many types of information. This paper describes a tool which is used to rapidly extend base classes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Khaos66, thanks for asking.
I agree that
ResourceGraphBuilder
being non-sealed without any virtual members is not very useful. We could open it up for extension, but in your case, that’s not going to solve your problem for two reasons:ResourceFieldAttribute.Property
, whose setter is internal.IIdentifiable
, which requires the 3rd party library to have a dependency on JsonApiDotNetCore.The way to solve this is by wrapping the type from the 3rd party library. I’ve attached a sample project that wraps
System.Version
. You can run it with F5, which shows sample data.WrappedThirdPartyResourceDemoApi.zip
For convenience, I’m adding the wrapper here as text too:
when running the project, it requests:
Which returns:
Hope that helps.
Glad to help 😃