-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I am retriving records from a database, and one or more of the columns is a json datatype stored in a single column. I represent this using the type JsonValue, which wraps serde_json::Value.
Right now, the following works just fine, but results in the SomeStruct type having a field with an unknown type.
pub struct SomeStruct {
#[ts(type="unknown")]
pub questionare_results: JsonValue,
}
#[repr(transparent)]
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
pub struct JsonValue(pub serde_json::Value);export type SomeStruct = { questionare_results: unknown, };Somthing like this would be ideal:
pub struct SomeStruct {
#[ts(type="QuestionareResults", importedFrom="../QuestionareResults.ts")]
pub questionare_results: JsonValue,
}import type { QuestionareResults } from "../QuestionareResults.ts"
export type SomeStruct = { questionare_results: QuestionareResults, };Perhaps a default import as well?
pub struct SomeStruct {
#[ts(defaultType="QuestionareResults", importedFrom="../QuestionareResults.ts")]
pub questionare_results: JsonValue,
}import type QuestionareResults from "../QuestionareResults.ts"
export type SomeStruct = { questionare_results: QuestionareResults, };Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request