The `json-api-normalizer` package provides a utility to transform JSON:API compliant response data into a normalized, Redux-friendly format. Unlike general-purpose normalization libraries such as Normalizr, this package directly interprets the JSON:API specification, eliminating the need for manual schema definitions. It converts collections of resources into key-value maps, where keys are resource IDs, making it highly suitable for efficient state management within Redux applications. The current stable version is 1.0.4. Development appears to be largely inactive since 2017, with the last commit on GitHub approximately five years ago, suggesting a potentially abandoned status. Its primary differentiator is its direct, schema-less adherence to the JSON:API specification, providing a simpler setup for compliant APIs.
npm install json-api-normalizerVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to normalize a JSON:API response, including related 'included' data, and how to use the `endpoint` option to store request-specific metadata.
Consider migrating to a more actively maintained JSON:API client or normalization library, or fork the project for custom maintenance. Thorough testing is required if used in a modern stack.
Manually verify normalization behavior against your specific JSON:API server's response format, especially if your API uses newer JSON:API features or custom extensions.
Set `filterEndpoint: false` in the options object if you need distinct metadata entries for different query parameters (e.g., `normalize(json, { endpoint: '/posts?page=1', filterEndpoint: false })`).Change the import statement to `import normalize from 'json-api-normalizer';`
Ensure the `endpoint` option is passed to the `normalize` function with a string value representing the request endpoint, e.g., `normalize(json, { endpoint: '/api/resource' })`.No dependency data recorded yet.