mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
Implement optional scalars for JSON (#7322)
* Implement optional scalars for JSON * Add optional scalars JSON test * Extend JSON optional scalars test to test without defaults * Fix optional scalars in JSON for binary schema Co-authored-by: Caleb Zulawski <caleb.zulawski@caci.com>
This commit is contained in:
38
tests/optional_scalars_defaults.json
Normal file
38
tests/optional_scalars_defaults.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
just_i8: 4,
|
||||
maybe_i8: null,
|
||||
default_i8: 42,
|
||||
just_u8: 0,
|
||||
maybe_u8: 0,
|
||||
default_u8: 0,
|
||||
just_i16: 4,
|
||||
maybe_i16: null,
|
||||
default_i16: 42,
|
||||
just_u16: 0,
|
||||
maybe_u16: 0,
|
||||
default_u16: 0,
|
||||
just_i32: 4,
|
||||
maybe_i32: null,
|
||||
default_i32: 42,
|
||||
just_u32: 0,
|
||||
maybe_u32: 0,
|
||||
default_u32: 0,
|
||||
just_i64: 4,
|
||||
maybe_i64: null,
|
||||
default_i64: 42,
|
||||
just_u64: 0,
|
||||
maybe_u64: 0,
|
||||
default_u64: 0,
|
||||
just_f32: 4.0,
|
||||
maybe_f32: null,
|
||||
default_f32: 42.0,
|
||||
just_f64: 0.0,
|
||||
maybe_f64: 0.0,
|
||||
default_f64: 0.0,
|
||||
just_bool: true,
|
||||
maybe_bool: null,
|
||||
default_bool: false,
|
||||
just_enum: "None",
|
||||
maybe_enum: "One",
|
||||
default_enum: "Two"
|
||||
}
|
||||
Reference in New Issue
Block a user