Skip to content

Conversation

@dmitrii-ubskii
Copy link
Member

Usage and product changes

We implement serde's Serialize for ConceptDocument and our custom JSON type. This allows crates like axum that rely on serde to seamlessly return Json<ConceptDocument> from request handlers.

We also implement Deserialize for JSON for convenience.

Implementation

Closes #766

seq.end()
}
Self::String(string) => serializer.serialize_str(string),
&Self::Number(number) => serializer.serialize_f64(number),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh do all our JSONS only return floats?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're following the JSON spec here.

Copy link
Member

@flyingsilverfin flyingsilverfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but i just noticed we only have f64 for numbers - was that something we intended?

@dmitrii-ubskii dmitrii-ubskii merged commit c467bc8 into typedb:master Sep 9, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON or ConceptDocument should implement Serialize

2 participants