kt.jsonapi

kt.jsonapi supports generation of JSON:API responses using adaptation from application objects.

Input validation for JSON:API is not currently provided, but is planned for the future.

The current implementation works with the Flask web framework.

JSON:API features supported

Compound documents

Inclusion of Related Resources describes use of the include query parameter to drive the inclusion of additional related resources in a response. This query string is handled directly when responses are generated using the collection() and resource() methods (the only times include makes sense).

Sparse Fieldsets

Sparse Fieldsets defines a way for clients to limit the fields returned for particular types of resources using query parameters of the form fields[TYPENAME], where TYPENAME is replaced by a type identifier. No additional support from the application is required.

Collection handling

Collections of resources may be sortable, filterable, and pagable, though they are not required to be any of these. Each requires additional support from the application. Collection objects should additionally implement IFilterableCollection, ISortableCollection, and IPagableCollection as appropriate.