Is there a way to integrate Json API on .netcore boilerplate?

275 views Asked by At

I would like to implement jsonapi standard into my existing .netcore abp project and realized that the controller seem not working. Is there anyone has a solution for this?

https://jsonapi.org/

I want to have a following benefit from jsonapi.

  1. filter
  2. fieldset

TIA

1

There are 1 answers

2
Ankit Vijay On

You can integrate with JSON API spec using JSONApiNetCore library. This can be a great starting point to represent your existing .NET Core APIs in JSON API. The library provides great flexibility and extension points to integrate with your existing infrastructure.

Here are some of the options the library provides you:

  • You can directly integrate with built-in entity framework infrastructure and API endpoints by inheriting your Controller from JsonApiController.

  • Or, You can choose to inherit your Controller from BaseJsonApiController and then implement IResourceService to hook your existing code.

  • You can even go granular by implementing services such as ICreateService, or IUpdateService etc.

In addition to this, the library provides a nice way to handle errors by extending ExceptionHandler.

Check out their documentation for a complete list of features.

One of the things to keep in mind is that, while Swagger/Open-API integration is possible, there is no official documentation yet. It may require some custom code to set it up.