Skip to main content
Glama
combining-with-serialize.md760 B
## Combining with Serialize Use both Serialize and Deserialize for complete JSON round-trip support: <InteractiveMacro code={`/** @derive(Serialize, Deserialize) */ /** @serde({ rename_all: "camelCase" }) */ class UserProfile { user_name: string; created_at: Date; is_active: boolean; }`} /> ```typescript // Create and serialize const profile = new UserProfile(); profile.user_name = "Alice"; profile.created_at = new Date(); profile.is_active = true; const json = JSON.stringify(profile); // {"userName":"Alice","createdAt":"2024-...","isActive":true} // Deserialize back const restored = UserProfile.fromJSON(JSON.parse(json)); console.log(restored.user_name); // "Alice" console.log(restored.created_at instanceof Date); // true ```

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/macroforge-ts/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server