Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the valid primitive types #430

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions rust/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,25 @@ impl SchemaTypeMap {
}
}

/*
* List of primitive types:
* string: utf8
* long // undocumented, i64?
* integer: i32
* short: i16
* byte: i8
* float: f32
* double: f64
* boolean: bool
* binary: a sequence of binary data
* date: A calendar date, represented as a year-month-day triple without a timezone
* timestamp: Microsecond precision timestamp without a timezone
*/
/// Enum with variants for each top level schema data type.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
#[serde(untagged)]
pub enum SchemaDataType {
/// Variant representing non-array, non-map, non-struct fields. Wrapped value will contain the
/// the string name of the primitive type.
///
/// Valid values are:
/// * string: utf8
/// * long // undocumented, i64?
/// * integer: i32
/// * short: i16
/// * byte: i8
/// * float: f32
/// * double: f64
/// * boolean: bool
/// * binary: a sequence of binary data
/// * date: A calendar date, represented as a year-month-day triple without a timezone
/// * timestamp: Microsecond precision timestamp without a timezone
primitive(String),
/// Variant representing a struct.
r#struct(SchemaTypeStruct),
Expand Down