JSON:API Implementing Filtering

Introduction It has been over a year since I last wrote about JSON:API, since then the team behind JSON:API has published version 1.1 of the JSON:API specification. I would like to continue my journey of documenting JOSN:API in .NET by introducing a really cool feature to my Chinook JSON:API project, filtering. The first thing to know about filtering in JSON:API is that the spec itself is agnostic to any filtering strategies....

October 15, 2023 · Yunier

JSON:API - Pagination Links

It has been a while since I blogged about JSON:API. In my last post on JSON:API I covered how to create new resources. In today’s post, I want to go over how I expose pagination links. Pagination links allow a client to page through a collection of resources. A shift of control from the client back to the server. Here is an example of a possible JSON:API response that includes pagination links....

January 25, 2022 · Yunier

JSON:API - Creating New Resources

So far in my JSON:API series I’ve covered the home resource, adding your own resource, adding an exception handling middleware and how to expose relationship between resources. For the today’s post, I would like to cover creating resources. I will update the chinook project by allowing POST request on the customers collections to add new customers. To get started, the customer controller needs to have a method that will accept the incoming POST request....

August 8, 2021 · Yunier

JSON:API - Exposing Relationships

My previous post on JSON:API exposed customers as an API resource, since then, I have updated the project to expose all remaining resources, that includes Albums, Artists, Employees, Genres, Invoices, InvoiceItems, MediaTypes, Playlists, and Tracks. The time has come to expose the relationship that exist between these resource. For this post, I will expose the one-to-many relationship that exist between artists and albums. To accomplish this task I will have to update the class ArtistServiceModelConfiguration by using the ToManyRelationship method exposed by JsonApiFramework in order to link one artist to many albums....

December 6, 2020 · Yunier

JSON:API - Exposing The Customer Resource

This will be my third blog post on JSON:API in .NET Core. I plant to add Customer as an API resource, but before we get too deep on the code, I would like to review the Chinook database project. To do that I’m going to import Chinook.db into DB Browser for SQLite to see all available entities. As you can see we have quite a few entities, for this blog post I will concentrate on the customers entity....

October 30, 2020 · Yunier