1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! JSON:API 1.1 Implementation for Rust
//!
//! This crate provides a framework-agnostic implementation of the [JSON:API 1.1 specification](https://jsonapi.org/).
//! It includes data structures for JSON:API documents, resources, errors, and helper functions
//! for creating compliant responses.
//!
//! # Features
//!
//! - Fully compliant with JSON:API 1.1 specification
//! - Framework-agnostic design (works with Axum, Actix, Rocket, etc.)
//! - Support for resources, relationships, errors, and metadata
//! - Query parameter support for filtering, sorting, pagination, etc.
//! - Extensible and customizable
//!
//! # Usage
//!
//! ```rust
//! use rjapi::{JsonApiResponse, Resource};
//! use serde_json::json;
//!
//! let attributes = json!({
//! "title": "Example Post",
//! "content": "This is an example post."
//! });
//!
//! let resource = Resource {
//! resource_type: "posts".to_string(),
//! id: "1".to_string(),
//! attributes: Some(attributes),
//! relationships: None,
//! links: None,
//! meta: None,
//! };
//!
//! // Create a JSON:API response
//! let response = JsonApiResponse::new(resource).build();
//! println!("{}", serde_json::to_string_pretty(&response).unwrap());
//! ```
pub use *;
pub use *;
pub use *;
// Re-export http crate for convenience
pub use http;