Question:
I often work on Web API projects using .NET, and I find the idea of allowing clients to specify which data fields to retrieve—similar to GraphQL—quite intriguing. However, I haven’t come across any libraries that support this in RESTful APIs. I’m wondering if this idea is considered outdated.
GET /api/User/?fields=name&fields=Email&populate[Role][fields]=name
And receive:
{
"name": "John Doe",
"email": "[email protected]",
...
"role": {
"name": "Admin"
...
}
}
So, I created a simple .NET library to handle this. Contributions and feedback are welcome! GitHub: https://github.com/Authentic199/Population.NET.
I’d love to hear insights from those who’ve implemented similar APIs or considered dynamic field selection as part of their API design.
I tried searching for similar library but couldn’t find any, so I look forward to everyone’s opinion
Authentic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2