use axum::{Json, extract::Path}; use serde::{Deserialize, Serialize}; use crate::USER; // { // "@context": "https://www.w3.org/ns/activitystreams", // "type": "Person", // "name": "Sally Smith", // "id": "https://testhost.com/users/test" // } #[derive(Serialize)] pub struct UsersResponse { #[serde(rename = "@context")] context: String, r#type: String, name: String, id: String, } pub async fn users_get(Path(user): Path) -> Json { assert_eq!(user, USER); Json(UsersResponse { context: "https://www.w3.org/ns/activitystreams".to_string(), r#type: "Person".to_string(), name: "Sally Smith".to_string(), id: "https://testhost.com/users/test".to_string(), }) }