Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit bf45927

Browse files
committed
Add metadata field to Activities
1 parent cc3398f commit bf45927

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/api_documentation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ See [Gateway](#gateway)
105105
- `title`: `string`
106106
- `description`: `string`
107107
- `started`: `Timestamp`
108+
- `metadata`: `Metadata?`
109+
110+
##### Metadata
111+
112+
- `type`: `string`
113+
- `attributes`: opaque json object with additional attributes for this activity
108114

109115
#### Errors
110116

src/endpoints/user.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use chrono::{DateTime, Utc};
77
use log::warn;
88
use reqwest::StatusCode;
99
use serde::{Deserialize, Serialize};
10+
use serde_json::Value;
1011
use sqlx::{query, query_scalar, Type};
1112
use uuid::Uuid;
1213

@@ -46,6 +47,8 @@ pub struct Activity {
4647
title: String,
4748
description: String,
4849
started: DateTime<Utc>,
50+
#[serde(skip_serializing_if = "Value::is_null", default)]
51+
metadata: Value,
4952
}
5053

5154
#[derive(Deserialize, Serialize, Type)]

0 commit comments

Comments
 (0)