Module activitypub_federation::axum::json
source · Expand description
Wrapper struct to respond with application/activity+json
in axum handlers
async fn http_get_user(Path(name): Path<String>, data: Data<DbConnection>) -> Result<FederationJson<WithContext<Person>>, Error> {
let user: DbUser = data.read_local_user(&name).await?;
let person = user.into_json(&data).await?;
Ok(FederationJson(WithContext::new_default(person)))
}
Structs§
- Wrapper struct to respond with
application/activity+json
in axum handlers